[cmake-developers] How to detect the compiler ID for the IAR C/C++ compilers

Alexander Neundorf neundorf at kde.org
Sun Aug 15 11:01:02 EDT 2010


Hi,

I have basically fully working support for the IAR compilers here locally, 
i.e. files Modules/Compiler/IAR-C.cmake and IAR-CXX.cmake.

The biggest issue with this compiler is to detect its compiler ID.

The binary files it produces don't contain the plain string, but the 
characters from the string and before each character a 0x36 byte.
The full story can be found here: 
http://public.kitware.com/Bug/view.php?id=10176, search for "19598".

I see two options how to detect it:

1) add a special file handler for these types of files, which first reads the 
file as it is, then all odd bytes, then all even bytes. This way it gets also 
the plain strings with the IAR compiler. This is tested and works.
But it feels to me like a hack, since I don't know what is actually going on 
there.

2) use the CMAKE_DETERMINE_COMPILER_ID_VENDOR() function provided by 
CMakeDetermineCompilerID.cmake and add switches for the IAR C/C++ compilers 
(as is done for the Compaq Fortran compiler).
I would prefer this over the first one.

What do you recommend ?

Alex



More information about the cmake-developers mailing list