> Currently you're detecting the compiler with:
> 
>    /* __ARMCC_VERSION = PVVbbbb */
>  # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ARMCC_VERSION/1000000)
>  # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ARMCC_VERSION/10000 % 
> 100)
>  # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ARMCC_VERSION     % 
> 10000)")
> 
> Do all the compilers define that?  Are they different?  Is there another 
> preprocessor definition that distinguishes them?  Do they also define 
> __GNUC__ and/or > __clang__?
I can't test the armclang defines, so the information I have about those comes 
from what I can read in its documentation.

armcc defines:
* __ARMCC_VERSION (version)
* __CC_ARM (1)
* __GNUC__ (version) (only if --gnu is passed as a commad line option)

armclang defines:
* __ARMCC_VERSION (version)
* __ARMCOMPILER_VERSION (version)
* __GNUC__ (version)
* Note that it does *not* define __clang__

arm-linux-gnueabihf-gcc defines:
* __GNUC__ (version)

So if we're interested in giving support only to armcc, then we could use 
_CC_ARM to find out whether we are actually invoking it, and then after 
__ARMCC_VERSION to find out the actual compiler version.

-Joakim
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to