Skip to content

Different compiler for build targets inside a subdir #12183

Answered by eli-schwartz
mahmnv asked this question in Q&A
Discussion options

You must be logged in to vote

Meson enforces consistency at the "machine" level. Mixing and matching different compilers for the same language is forbidden at the generic level -- you can't build one program with amd64 GCC and the other with amd64 clang -- but specifically allowed as part of cross build support.

See https://mesonbuild.com/Cross-compilation.html

Cross compile builds need to be specifically set up with a toolchain (machine) file defining the cross-specific compiler. Build targets that need to be built for the build (native) machine as part of the same ninja invocation will instead use $CC_FOR_BUILD or whatever the default is on PATH.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@eli-schwartz
Comment options

@mahmnv
Comment options

@xclaesse
Comment options

xclaesse Nov 6, 2023
Collaborator

@eli-schwartz
Comment options

@mahmnv
Comment options

Answer selected by mahmnv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants