[build][cmake] Fix cmake with custom assembler#3382
Conversation
|
I think the The needed fix is to make cmake use CMAKE_C_COMPILER instead of CMAKE_ASM_COMPILER Since it is currently passing all the configured C flags, then it needs to be sent to a C compiler ? |
|
The default configuration when you run cmake, is to set the ASM compiler to "gcc" But in Buildroot config, they explicitly define the ASM (cross) compiler to be "as"
Which "makes sense", I suppose, but breaks the assumption that .S files are handled by cc |
02a5163 to
d1dd8fc
Compare
|
Good point, I had only tested on my Mac. This now passes on both my Mac and Linux machines with We just set the source language to C. While this isn't ideal, it looks like CMake is preserving this behavior for backwards compatibility. |
Tell CMake to explicitly compile our assembly as C code, because we require it is compiled by a C compiler, and it is only enabled for clang/gcc. Fixes facebook#3193.
|
I can confirm that this works now on my Gentoo system as well, thank you! |
Fixes cmake build when the C compiler isn't used as the assembler. We need to explicitly set the flag
-x assembler-with-cppto enable the preprocessor.Fixes #3193.