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

Attachment: XMOS-ASM.cmake
Description: Binary data

Attachment: CMakeDetermineASMCompiler.cmake
Description: Binary data

--
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to