project() compiler test doesn't respect CMAKE_C_COMPILER_TARGET
When CMAKE_C_COMPILER_TARGET
is set, the CMakeTestCCompiler
call invoked by project(blah C)
does not include -target
, which will cause failures in cases where cross-compilation occurs with custom CMAKE_C_COMPILER_FLAGS
, which do get passed down (for example -march=armv
in the cflags will cause a failure if you try to compile for the host target). Even if it doesn't fail, it will silently succeed at compiling for the host architecture, even though the user is trying to cross-compile and target the architecture they specify.