Meson build system cannot be used for cross builds #661

Closed
opened 2024-02-29 08:41:33 -06:00 by amyspark · 4 comments
amyspark commented 2024-02-29 08:41:33 -06:00 (Migrated from github.com)

Hi,

This is to report that CMake-based subprojects, like the one hidapi's Meson build system uses, do not work for cross builds: https://github.com/mesonbuild/meson/issues/12761

We found this issue when attempting to cross compile https://github.com/blackmagic-debug/blackmagic from arm64 AppleClang to arm64-none-eabi-gcc (see towards the end).

Hi, This is to report that CMake-based subprojects, like the one hidapi's Meson build system uses, do not work for cross builds: https://github.com/mesonbuild/meson/issues/12761 We found this issue when attempting to cross compile https://github.com/blackmagic-debug/blackmagic [from arm64 AppleClang to arm64-none-eabi-gcc](https://files.xobs.io/file/XAszURPYyXBwEUMs/AZzdyuO9IYNO1deQ/meson-log.txt) (see towards the end).
Youw commented 2024-02-29 10:27:11 -06:00 (Migrated from github.com)
Is this something that may be fixed by modifying https://github.com/libusb/hidapi/blob/master/meson.build + https://github.com/libusb/hidapi/blob/master/subprojects/hidapi_build_cmake/CMakeLists.txt or is this a general limitation of https://mesonbuild.com/CMake-module.html ?
amyspark commented 2024-02-29 14:30:13 -06:00 (Migrated from github.com)

Neither, Meson currently just doesn't pass the correct variables in the toolchain file (it passes the build machine's and not the host's). The only way we know to fix it is turn the meson.build into a complete port.

Neither, Meson currently just doesn't pass the correct variables in the toolchain file (it passes the build machine's and not the host's). The only way we know to fix it is turn the meson.build into a complete port.
Youw commented 2024-02-29 14:48:29 -06:00 (Migrated from github.com)

So we're back to the question "who is going to support it?".
Multiple supported build systems is not something any sain maintainer would sign up just for convenience.
The community is free to have its own implementation of Meson build system for HIDAPI.
Similar way to how https://github.com/trezor/cython-hidapi exists.

So we're back to the question "who is going to support it?". Multiple supported build systems is not something any sain maintainer would sign up just for convenience. The community is free to have its own implementation of Meson build system for HIDAPI. Similar way to how https://github.com/trezor/cython-hidapi exists.
Youw commented 2024-02-29 14:49:35 -06:00 (Migrated from github.com)

Closing as a limitation of Meson's CMake-module.html.

Closing as a limitation of Meson's [CMake-module.html](https://mesonbuild.com/CMake-module.html).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi#661
No description provided.