compilation options for cmake (on windows) for ARM target system but when I run configure it's starting compiler tests:
CMake Error at D:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "D:/Program Files/yagarto/bin/arm-none-eabi-gcc.exe" is not
able to compile a simple test program.
It fails with the following output:
Change Dir: D:/merge/complex/build/CMakeFiles/CMakeTmp
Run Build Command:D:/PROGRA~1/YAGART~1/bin/make.exe "cmTryCompileExec/fast"
D:/PROGRA~1/YAGART~1/bin/make.exe -f
CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
make.exe[1]: Entering directory
`D:/merge/complex/build/CMakeFiles/CMakeTmp'
"D:/Program Files/CMake 2.8/bin/cmake.exe" -E cmake_progress_report
D:/merge/complex/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
"D:/Program Files/yagarto/bin/arm-none-eabi-gcc.exe" -o
CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
D:/merge/complex/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec
"D:/Program Files/yagarto/bin/arm-none-eabi-gcc.exe"
"CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o" -o cmTryCompileExec
-rdynamic
arm-none-eabi-gcc.exe: error: unrecognized option '-rdynamic'
make.exe[1]: *** [cmTryCompileExec] Error 1
Using Yagatdo 4.6.* cross-compilation toolchain
How can I skip this tests or fix -rdynamic error that I am getting?
You can skip the compiler checks by adding
NONE
to yourproject
call:but this can have pretty far-reaching effects. For full details, run
I'm not familiar with ARM, so this is probably not your best option here. I guess you'd be better to see if there's a way to fix the
-rdynamic
flag.EDIT:
It looks like this was identified as a bug which is effectively still unresolved. The comments in the bug report mention adding the following lines as a workaround (presumably before your
project
call):If you're just compiling a static library and you want to avoid having CMake test that the compiler can generate binaries, you can set the variable
CMAKE_TRY_COMPILE_TARGET_TYPE
.It seems you target actually something else than Linux, so you should tell cmake that you are cross-compiling for the generic case:
Followed by (optionally, but nice to specify):
However, if you specify (which you likely did because this is stated in a lot of examples online):
Then cmake will load the configuration files from (suppose version 2.8) the file:
from which it is likely to load:
Here the
-rdynamic
flag is set for historical reasons:Rather than disabling the tests as indeed is done by specifying
NONE
as thePROJECT
argument, it seems setting theCMAKE_SYSTEM_NAME
(to something else thanLinux
, for instanceGeneric
) is what you actually want to do.You can set
CMAKE_<LANG>_COMPILER_WORKS
to true to suppress further compiler checks for that language.