Open maiphi opened 1 month ago
Turns out this is not the only issue.
Replacing i8
by ::std::os::raw::c_char
in core/callbacks.rs
, core/data.rs
and core/input.rs
makes the code compile.
But then linking to an example program fails, because it wants to link bcm_host
, brcmEGL
, brcmGLESv2
and vcos
, i.e. Raspberry Pi/Broadcom libraries.
It seems that the build system erroneously detects the platform as "Raspberry Pi" (passed to cmake when building raylib).
The problem with the platform detection is in raylib-sys/build.rs:359-360
. There it is assumed that the target armv7-unknown-linux
implies that the platform is "Raspberry Pi". Commenting the two lines, compilation and linking is successful.
While the fix i8
→::std::os::raw::c_char
should be portable, of course, for the platform detection one would need something more sophisticated to detect the RPI. Personally, I'd be happy with a build option to specify the platform.
I'm trying to build raylib-rs master (5.0.0) for armv7-unknown-linux-gnueabihf. The build fails due to type mismatch between u8 and i8. I guess this is the same issue as described here: https://github.com/rust-lang/rust/issues/60226. There are several patches from projects linked that had the same problem.
Build log is attached: build.log
How to reproduce
Dockerfile:
podman build -t raylib_rs_env .
Cross.toml:
(edit: removed packages from Dockerfile which are not needed to build a small example; added libx11-dev:armhf)