# Using cmake for Microware os9 Compiler xcc(cross-compile) and g++(Linux)

**URL:** https://discourse.cmake.org/t/using-cmake-for-microware-os9-compiler-xcc-cross-compile-and-g-linux/14147
**Category:** Usage
**Created:** [May 24, 2025, 10:25am UTC](https://discourse.cmake.org/t/using-cmake-for-microware-os9-compiler-xcc-cross-compile-and-g-linux/14147 "2025-05-24T10:25:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mkneppe](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mkneppe](https://discourse.cmake.org/u/mkneppe)
#### Post date: [May 24, 2025, 10:25am UTC](https://discourse.cmake.org/t/using-cmake-for-microware-os9-compiler-xcc-cross-compile-and-g-linux/14147/1 "2025-05-24T10:25:31Z")

</div>

I am trying to use cmake to use the toolchain from Microware. The only post i found about this is:

> [@Non-standard compiler integration](https://discourse.cmake.org/t/non-standard-compiler-integration/7315):
>
> I try to build a project with cmake, that uses a quite special compiler. It is about the xcc compiler from MicroSys for the os OS-9. The interface of the compiler differs from other compilers, like its objects files are instead of .o files .r files. All argument specifiers are different (eg. -L is -l) and so on. I was not able to find a documentation on how to add a custom compiler to cmake. Can anybody help, or knows where to find the documentation? Best regards

but this did not help me.  
The xcc compiler generates .ii and .r files and the libgen links those to a .l file.  
As I have a project with 15 modules do not want to fiddle with every single module but would like to have the edit each individual cmake-file but would like to have the definitions in a central cmake-file.  
Getting cmake to build makefiles to compile the cpp into .r/.ii was quite easy as i only had to specify the CMAKE\_C\_COMPILER with the correct parameters. But I am not able to link the files as the cmake-command add\_library always considers the input-files for the linker beeing .o files.  
Is there a good way of getting cmake to use this xcc/libgen toolchain ?

Best regards;  
Martin
