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

Bernhard Sputh bernhard.sputh at gmail.com
Wed Oct 12 06:14:57 EDT 2011


Hi List,

I'm currently working on better integrating the XMOS toolchain [1]
(version 11.2.2) into CMake 2.8.5, among other things (such as TI
C6000 support). I've today managed to integrate the detection of the
XMOS assembler. Basically, all I had to do is to insert these three
lines in the file CMakeDetermingASMCompiler.cmake (find my modified
version attached, feel free to include in future versions):

LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XMOS )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XMOS "--version")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XMOS "XMOS Limited")

Furthermore, the file XMOS-ASM.cmake (attached, may be included as
well) has to be added to Modules/Compilers/. In this file the valid
extensions get set, which in our case are xc (special language from
XMOS to program their CPUs), s and S. I'm cheating a bit when
specifying the assembler executable because I use xcc instead of xas,
but this is necessary in order to get the xc-files processed
correctly. I'll clean this up at one point, but this workaround has
worked for us the past two years, and nothing lasts longer than a
working workaround.

The toolchain file to use looks as follows:

SET(CMAKE_SYSTEM_VERSION 2.8)
INCLUDE(CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME generic)
CMAKE_FORCE_C_COMPILER(xcc GNU)
CMAKE_FORCE_CXX_COMPILER(xcc GNU)
SET(CMAKE_COMPILER_IS_GNUCXX 1)
SET(CMAKE_ASM_COMPILER "xcc")


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.

Cheers
Bernhard


[1] https://www.xmos.com/products/development-tools
-------------- next part --------------
A non-text attachment was scrubbed...
Name: XMOS-ASM.cmake
Type: application/octet-stream
Size: 46 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111012/6ccb8beb/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeDetermineASMCompiler.cmake
Type: application/octet-stream
Size: 8826 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111012/6ccb8beb/attachment-0003.obj>


More information about the CMake mailing list