[CMake] XMOS ASM / C Compiler support progress and questions

Alexander Neundorf a.neundorf-work at gmx.net
Thu Oct 13 15:18:12 EDT 2011


On Thursday 13 October 2011, Bernhard Sputh wrote:
> Hi Alexander,
> 
> 2011/10/12 Alexander Neundorf <a.neundorf-work at gmx.net>:
> > Hi,
> > 
> > On Wednesday 12 October 2011, Bernhard Sputh wrote:
> > 
> > Cool :-)
> > Please create an entry in the bug tracker for that, so it doesn't get
> > lost.
> 
> OK, will do this later today.
> 
> > Since 2.8.5 the "ASM" language is the one to use for assembler files
> > which are processed by the C or C++ compiler, i.e. which may need to be
> > preprocessed. I.e. you shouldn't even have to set CMAKE_ASM_COMPILER,
> > when enabling ASM it will use the value of CMAKE_C_COMPILER for
> > CMAKE_ASM_COMPILER.
> 
> Ah good to know.
> 
> > Why do you set the compiler id to GNU ?
> > That's not a good idea I'd say.
> 
> The XMOS toolchain has for the basic functions compatible command line
> switches to the GNU toolchain. However, it's not based on GNU
> directly, but is based on LLVM [1] instead.

I'd suggest to set it to "XMOS" and also create a XMOS-C.cmake and XMOS-
CXX.cmake file in Compilers/. Then you are free to do there what you need.

> >> I would prefer to not to have not force the compiler, but the recent
> >> XMOS toolchain require an additional command line argument to specify
> >> the processor to compile for: `-target'. As far as I'm aware there is
> >> no way to pass additional compiler flags to the compiler checking
> >> operations.
> > 
> > How does the syntax look exactly ?
> > 
> > xcc -target Foo ....
> > or
> > xcc -target=Foo ...
> > ?
> > 
> > In the second case, it should work if you do
> > set(CMAKE_C_COMPILER xcc -target=Foo)
> 
> Thank you for that hint, it will be useful in the future.
> 
> To be precise there are two forms, one where one uses the from:
> - `-target=XC-1': To select the XC-1 development board.

Looks good. The "-target=XC-1" will be detected by cmake as first command line 
argument for the compiler and will be put internally into the 
CMAKE_C_COMPILER_ARG1 variable.

Alex


More information about the CMake mailing list