-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: Subproject does not use native-compilation for targets #12761
Comments
This is sort of a known issue because Meson assumes all subprojects (regardless of how they're being built) are for the host machine. I have some patches (now in need of a rebase): #12258 that fix this by allowing a subproject to be built for either the host or build machine, including CMake subprojects. The goal is that you would just say |
Aha! It looks like one of my colleagues on our project has been following along with this. I guess he figured out that we would need this before I did. 😁 He has been on hiatus for a few months now; is there anything that I can do to help out with getting those patches test and built? We have a workaround at the moment, but it involves either:
|
We've wound up hitting this bug in Black Magic Debug when a user tried building the firmware (cross-compiled) and associated host program which depends on HIDAPI. Please see the attached log. For the time being we're going to fully port HIDAPI to Meson, doing away with the subproject stub they have, to resolve this. This is not particularly maintainable though. |
Describe the bug
When building a cross-compilation C/C++ project, CMake subprojects do not seem to respect native compilation rules, instead preferring cross-compilation.
To Reproduce
For any necessary context, our full project is here.
I added the following lines to
./meson.build
, near the top of the file:And created the following file
armips.wrap
in oursubprojects
directory:When loading this subproject using the
cmake
module and attempting to pull in thearmips-bin
target (which should build the executable tool), Meson fails during project configuration:I inspected the generated
CMakeMesonToolchainFile.cmake
, and it indeed is loading the settings from our cross-compile configuration. I modified the native-compile configuration to include cmake module settings, but these were not picked up:The cmake
target
functions, to my knowledge, do not permit settingnative: true
like Meson targets. I tried to override these with subproject options, but that didn't seem to work, either:Expected behavior
Meson should build the CMake subproject using native-compile configuration rather than cross-compile.
system parameters
3.11.7
meson --version
1.2.1ninja --version
if it's a Ninja build 1.11.1The text was updated successfully, but these errors were encountered: