[CMake] Adding configuration for a new compiler

Hendrik Sattler post at hendrik-sattler.de
Thu Apr 10 08:01:02 EDT 2008


Zitat von Pau Garcia i Quiles <pgquiles at elpauer.org>:
> Quoting Alexander Neundorf <a.neundorf-work at gmx.net>:
>
>> On Wednesday 09 April 2008, Hendrik Sattler wrote:
>>> Hi,
>>>
>>> I would like to make CMake work with an embedded cross-compiler, namely
>>> nc30.
>>
>> What compiler is that ?
>> Google on nc30 gives this: http://www.v-four.freeserve.co.uk/vfr400.htm
>
> I guess he means
> http://www.renesas.com/fmwk.jsp?cnt=m3t_nc30wa_compiler_nc30.htm&fp=/products/tools/coding_tools/c_compilers_assemblers/m3t_nc30wa/child_folder/&title=Compiler%20NC30
>

Exactly. One of that where the programmers of it thought that leaving  
out vital options is better and giving it unique file extension makes  
it unique :-(
Assembler files get .a30 (CMAKE_ASSEMBLY_OUTPUT_EXTENSTION?), object  
files get .r30 (always relocatable, CMAKE_C_OUTPUT_EXTENSION) and  
executables get .x30 (CMAKE_EXECUTABLE_SUFFIX).

Example is the typical option -o: that is there, too, _but_ it must  
not specify an extension! How do I put this into  
CMAKE_C_COMPILER_OBJECT?
I guess I would need something equal to <TARGET_BASE> but for  
<OBJECT>, e.g. <OBJECT_BASE> (including path, excluding extension).

The C compiler test fails because CMake insists on createing  
testCCompiler.c.r30  and there doesn't seem to be way to tell it to  
not include the source file name extension (here: .c) into the object  
file name.
However, the linker takes the first dot as extension (I know that this  
is horribly broken) and only takes files that have ".r30" as  
extension. ".c.r30" is an illegal extension.
How can this be handled? The things that can be done with the stuff in  
<> is rather limited :-/

Suggestion:
Allow CMAKE_C_OUTPUT instead of CMAKE_C_OUTPUT_EXTENSION and I could  
specify that as "<OUTPUT_BASE>.r30" and for gcc e.g. "<OUTPUT>.o".

HS




More information about the CMake mailing list