[CMake] Cross compile to platform with two stage compiler.

Eric LaFranchi eric.lafranchi at voltage.com
Wed Jul 2 16:04:42 EDT 2014


Yes. The cross compiler is run on Windows and we are setup to use either Windows Command Prompt or Cygwin shell.
What arguments will be passed into the script that is set using the CMAKE_FORCE_C_COMPIELR macro? I assume this is going to be "compiler flags", "source file", and "target file"?
The compiler is not known to CMake and I assume that I will need to create a "Compiler"-C.cmake and put it in my local cmake modules path?
Thanks, Eric
From: Nils Gladitz [mailto:nilsgladitz at gmail.com]
Sent: Wednesday, July 02, 2014 11:34 AM
To: Eric LaFranchi; cmake at cmake.org
Subject: Re: [CMake] Cross compile to platform with two stage compiler.

On 02.07.2014 18:53, Eric LaFranchi wrote:
Currently we have 16 different platform that we target that are a combination of native compiles and cross compiles. I am adding a new platform to our build system using CMake's cross compiling facility. This platform is unique in that compiling a ".c" file to get an ".o" file required two steps. These steps: compile the source ".c" to generate a ".asm" file, then assemble that file to get the ".o" file.
For other cross compiled platforms I use CMAKE_FORCE_C_COMPILER, however I am not able to specify both the C compiler and assembler using this macro (my understanding is one compiler as the first argument). I have thought about using ADD_CUSTOM_COMMAND, however I don't want to write a custom command for several thousand C source files.
New ideas are greatly appreciated.

Could the compiler be a script that calls the actual compiler + assembler?

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140702/4af7a702/attachment.html>


More information about the CMake mailing list