cmake problems with arm gcc compiler

Hello, I have a working cmake project for an ARM gcc cross-compiler. I added "-D CMAKE_CXX_COMPILER=E:/.../gcc-arm-none-eabi-4_9-2015q2/bin/arm-none-eabi-gcc.exe" to the CMake options and the compiler is found, but I get the following error:

The C++ compiler
  "E:/.../gcc-arm-none-eabi-4_9-2015q2/bin/arm-none-eabi-gcc.exe"
  is not able to compile a simple test program.

...

.../gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe:
  unrecognized option '--out-implib'

Can anybody give me a hint what I have to change, so that the test program can be compiled without "--out-implib"? That option is not available on cross-compilers.

Regards, Peter

0
1 comment

To cross-compile with CMake, you have to set some additional variables (in your case it should be probably-DCMAKE_SYSTEM_NAME=Generic). Also the recommended way of cross-compiling with CMake is using toolchain files (and passing them via -DCMAKE_TOOLCHAIN_FILE=...). Please see the following tutorial http://www.vtk.org/Wiki/CMake_Cross_Compiling, it lists most used variables and also contains an example of a toolchain file. Please let me know if you have any additional questions.

0

Please sign in to leave a comment.