Merge topic 'compiler-id-refactor'
3b59f8b7 Project: Refactor C compiler determination into multiple files. 8896501b CompilerId: Allow specifying a prefix for preprocessor defines. 23f451bb CompilerId: Guard the platform-default compiler code with a parameter. 30a99f5c CompilerId: Add option to generate compiler-id-specific defines. 36ed5894 CompilerId: Allow specifying the compiler-specific components to generate. 9a083bce Project: Split the compiler id detection into a separate function. 9d285600 Project: Generate the CXX compiler Id test from multiple files.
This commit is contained in:
commit
6eafe843ca
@ -2,234 +2,11 @@
|
|||||||
# error "A C++ compiler has been selected for C."
|
# error "A C++ compiler has been selected for C."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Version number components: V=Version, R=Revision, P=Patch
|
|
||||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
|
||||||
|
|
||||||
#if defined(__18CXX)
|
#if defined(__18CXX)
|
||||||
# define ID_VOID_MAIN
|
# define ID_VOID_MAIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
@CMAKE_C_COMPILER_ID_CONTENT@
|
||||||
# define COMPILER_ID "Intel"
|
|
||||||
/* __INTEL_COMPILER = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
|
||||||
# if defined(__INTEL_COMPILER_UPDATE)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
|
||||||
# else
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
|
||||||
# endif
|
|
||||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
|
||||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
|
||||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
|
||||||
# endif
|
|
||||||
# if defined(_MSC_VER)
|
|
||||||
# define SIMULATE_ID "MSVC"
|
|
||||||
/* _MSC_VER = VVRR */
|
|
||||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
|
||||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__PATHCC__)
|
|
||||||
# define COMPILER_ID "PathScale"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
|
||||||
# if defined(__PATHCC_PATCHLEVEL__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__clang__)
|
|
||||||
# if defined(__apple_build_version__)
|
|
||||||
# define COMPILER_ID "AppleClang"
|
|
||||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
|
||||||
# else
|
|
||||||
# define COMPILER_ID "Clang"
|
|
||||||
# endif
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
|
||||||
# if defined(_MSC_VER)
|
|
||||||
# define SIMULATE_ID "MSVC"
|
|
||||||
/* _MSC_VER = VVRR */
|
|
||||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
|
||||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
|
||||||
# define COMPILER_ID "Embarcadero"
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)
|
|
||||||
|
|
||||||
#elif defined(__BORLANDC__)
|
|
||||||
# define COMPILER_ID "Borland"
|
|
||||||
/* __BORLANDC__ = 0xVRR */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
|
||||||
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
# if __WATCOMC__ < 1200
|
|
||||||
# define COMPILER_ID "Watcom"
|
|
||||||
/* __WATCOMC__ = VVRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
|
||||||
# else
|
|
||||||
# define COMPILER_ID "OpenWatcom"
|
|
||||||
/* __WATCOMC__ = VVRP + 1100 */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
|
||||||
# endif
|
|
||||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
|
||||||
# if (__WATCOMC__ % 10) > 0
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__SUNPRO_C)
|
|
||||||
# define COMPILER_ID "SunPro"
|
|
||||||
# if __SUNPRO_C >= 0x5100
|
|
||||||
/* __SUNPRO_C = 0xVRRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
|
||||||
# else
|
|
||||||
/* __SUNPRO_C = 0xVRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__HP_cc)
|
|
||||||
# define COMPILER_ID "HP"
|
|
||||||
/* __HP_cc = VVRRPP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
|
|
||||||
|
|
||||||
#elif defined(__DECC)
|
|
||||||
# define COMPILER_ID "Compaq"
|
|
||||||
/* __DECC_VER = VVRRTPPPP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
|
|
||||||
|
|
||||||
#elif defined(__IBMC__)
|
|
||||||
# if defined(__COMPILER_VER__)
|
|
||||||
# define COMPILER_ID "zOS"
|
|
||||||
# else
|
|
||||||
# if __IBMC__ >= 800
|
|
||||||
# define COMPILER_ID "XL"
|
|
||||||
# else
|
|
||||||
# define COMPILER_ID "VisualAge"
|
|
||||||
# endif
|
|
||||||
/* __IBMC__ = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__PGI)
|
|
||||||
# define COMPILER_ID "PGI"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
|
||||||
# if defined(__PGIC_PATCHLEVEL__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(_CRAYC)
|
|
||||||
# define COMPILER_ID "Cray"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
|
||||||
|
|
||||||
#elif defined(__TI_COMPILER_VERSION__)
|
|
||||||
# define COMPILER_ID "TI"
|
|
||||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
|
||||||
|
|
||||||
#elif defined(__TINYC__)
|
|
||||||
# define COMPILER_ID "TinyCC"
|
|
||||||
|
|
||||||
#elif defined(__SCO_VERSION__)
|
|
||||||
# define COMPILER_ID "SCO"
|
|
||||||
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
# define COMPILER_ID "GNU"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
|
||||||
# if defined(__GNUC_PATCHLEVEL__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
# define COMPILER_ID "MSVC"
|
|
||||||
/* _MSC_VER = VVRR */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
|
||||||
# if defined(_MSC_FULL_VER)
|
|
||||||
# if _MSC_VER >= 1400
|
|
||||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
|
||||||
# else
|
|
||||||
/* _MSC_FULL_VER = VVRRPPPP */
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# if defined(_MSC_BUILD)
|
|
||||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Analog VisualDSP++ >= 4.5.6 */
|
|
||||||
#elif defined(__VISUALDSPVERSION__)
|
|
||||||
# define COMPILER_ID "ADSP"
|
|
||||||
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
|
||||||
|
|
||||||
/* Analog VisualDSP++ < 4.5.6 */
|
|
||||||
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
|
|
||||||
# define COMPILER_ID "ADSP"
|
|
||||||
|
|
||||||
/* IAR Systems compiler for embedded systems.
|
|
||||||
http://www.iar.com */
|
|
||||||
#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
|
|
||||||
# define COMPILER_ID "IAR"
|
|
||||||
|
|
||||||
/* sdcc, the small devices C compiler for embedded systems,
|
|
||||||
http://sdcc.sourceforge.net */
|
|
||||||
#elif defined(SDCC)
|
|
||||||
# define COMPILER_ID "SDCC"
|
|
||||||
/* SDCC = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
|
|
||||||
|
|
||||||
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
|
|
||||||
# define COMPILER_ID "MIPSpro"
|
|
||||||
# if defined(_SGI_COMPILER_VERSION)
|
|
||||||
/* _SGI_COMPILER_VERSION = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
|
|
||||||
# else
|
|
||||||
/* _COMPILER_VERSION = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* These compilers are either not known or too old to define an
|
|
||||||
identification macro. Try to identify the platform and guess that
|
|
||||||
it is the native compiler. */
|
|
||||||
#elif defined(__sgi)
|
|
||||||
# define COMPILER_ID "MIPSpro"
|
|
||||||
|
|
||||||
#elif defined(__hpux) || defined(__hpua)
|
|
||||||
# define COMPILER_ID "HP"
|
|
||||||
|
|
||||||
#else /* unknown compiler */
|
|
||||||
# define COMPILER_ID ""
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Construct the string literal in pieces to prevent the source from
|
/* Construct the string literal in pieces to prevent the source from
|
||||||
getting matched. Store it in a pointer rather than an array
|
getting matched. Store it in a pointer rather than an array
|
||||||
|
@ -5,224 +5,7 @@
|
|||||||
# error "A C compiler has been selected for C++."
|
# error "A C compiler has been selected for C++."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Version number components: V=Version, R=Revision, P=Patch
|
@CMAKE_CXX_COMPILER_ID_CONTENT@
|
||||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
|
||||||
|
|
||||||
#if defined(__COMO__)
|
|
||||||
# define COMPILER_ID "Comeau"
|
|
||||||
/* __COMO_VERSION__ = VRR */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
|
|
||||||
|
|
||||||
#elif defined(__INTEL_COMPILER) || defined(__ICC)
|
|
||||||
# define COMPILER_ID "Intel"
|
|
||||||
/* __INTEL_COMPILER = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
|
||||||
# if defined(__INTEL_COMPILER_UPDATE)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
|
||||||
# else
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
|
||||||
# endif
|
|
||||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
|
||||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
|
||||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
|
||||||
# endif
|
|
||||||
# if defined(_MSC_VER)
|
|
||||||
# define SIMULATE_ID "MSVC"
|
|
||||||
/* _MSC_VER = VVRR */
|
|
||||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
|
||||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__PATHCC__)
|
|
||||||
# define COMPILER_ID "PathScale"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
|
||||||
# if defined(__PATHCC_PATCHLEVEL__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__clang__)
|
|
||||||
# if defined(__apple_build_version__)
|
|
||||||
# define COMPILER_ID "AppleClang"
|
|
||||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
|
||||||
# else
|
|
||||||
# define COMPILER_ID "Clang"
|
|
||||||
# endif
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
|
||||||
# if defined(_MSC_VER)
|
|
||||||
# define SIMULATE_ID "MSVC"
|
|
||||||
/* _MSC_VER = VVRR */
|
|
||||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
|
||||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
|
||||||
# define COMPILER_ID "Embarcadero"
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)
|
|
||||||
|
|
||||||
#elif defined(__BORLANDC__)
|
|
||||||
# define COMPILER_ID "Borland"
|
|
||||||
/* __BORLANDC__ = 0xVRR */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
|
||||||
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
# if __WATCOMC__ < 1200
|
|
||||||
# define COMPILER_ID "Watcom"
|
|
||||||
/* __WATCOMC__ = VVRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
|
||||||
# else
|
|
||||||
# define COMPILER_ID "OpenWatcom"
|
|
||||||
/* __WATCOMC__ = VVRP + 1100 */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
|
||||||
# endif
|
|
||||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
|
||||||
# if (__WATCOMC__ % 10) > 0
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__SUNPRO_CC)
|
|
||||||
# define COMPILER_ID "SunPro"
|
|
||||||
# if __SUNPRO_CC >= 0x5100
|
|
||||||
/* __SUNPRO_CC = 0xVRRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
|
||||||
# else
|
|
||||||
/* __SUNPRO_CC = 0xVRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__HP_aCC)
|
|
||||||
# define COMPILER_ID "HP"
|
|
||||||
/* __HP_aCC = VVRRPP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
|
|
||||||
|
|
||||||
#elif defined(__DECCXX)
|
|
||||||
# define COMPILER_ID "Compaq"
|
|
||||||
/* __DECCXX_VER = VVRRTPPPP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
|
|
||||||
|
|
||||||
#elif defined(__IBMCPP__)
|
|
||||||
# if defined(__COMPILER_VER__)
|
|
||||||
# define COMPILER_ID "zOS"
|
|
||||||
# else
|
|
||||||
# if __IBMCPP__ >= 800
|
|
||||||
# define COMPILER_ID "XL"
|
|
||||||
# else
|
|
||||||
# define COMPILER_ID "VisualAge"
|
|
||||||
# endif
|
|
||||||
/* __IBMCPP__ = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(__PGI)
|
|
||||||
# define COMPILER_ID "PGI"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
|
||||||
# if defined(__PGIC_PATCHLEVEL__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(_CRAYC)
|
|
||||||
# define COMPILER_ID "Cray"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
|
||||||
|
|
||||||
#elif defined(__TI_COMPILER_VERSION__)
|
|
||||||
# define COMPILER_ID "TI"
|
|
||||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
|
||||||
|
|
||||||
#elif defined(__SCO_VERSION__)
|
|
||||||
# define COMPILER_ID "SCO"
|
|
||||||
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
# define COMPILER_ID "GNU"
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
|
||||||
# if defined(__GNUC_PATCHLEVEL__)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
# define COMPILER_ID "MSVC"
|
|
||||||
/* _MSC_VER = VVRR */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
|
||||||
# if defined(_MSC_FULL_VER)
|
|
||||||
# if _MSC_VER >= 1400
|
|
||||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
|
||||||
# else
|
|
||||||
/* _MSC_FULL_VER = VVRRPPPP */
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# if defined(_MSC_BUILD)
|
|
||||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Analog VisualDSP++ >= 4.5.6 */
|
|
||||||
#elif defined(__VISUALDSPVERSION__)
|
|
||||||
# define COMPILER_ID "ADSP"
|
|
||||||
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
|
||||||
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
|
||||||
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
|
||||||
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
|
||||||
|
|
||||||
/* Analog VisualDSP++ < 4.5.6 */
|
|
||||||
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
|
|
||||||
# define COMPILER_ID "ADSP"
|
|
||||||
|
|
||||||
/* IAR Systems compiler for embedded systems.
|
|
||||||
http://www.iar.com */
|
|
||||||
#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
|
|
||||||
# define COMPILER_ID "IAR"
|
|
||||||
|
|
||||||
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
|
|
||||||
# define COMPILER_ID "MIPSpro"
|
|
||||||
# if defined(_SGI_COMPILER_VERSION)
|
|
||||||
/* _SGI_COMPILER_VERSION = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
|
|
||||||
# else
|
|
||||||
/* _COMPILER_VERSION = VRP */
|
|
||||||
# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
|
|
||||||
# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
|
|
||||||
# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* These compilers are either not known or too old to define an
|
|
||||||
identification macro. Try to identify the platform and guess that
|
|
||||||
it is the native compiler. */
|
|
||||||
#elif defined(__sgi)
|
|
||||||
# define COMPILER_ID "MIPSpro"
|
|
||||||
|
|
||||||
#elif defined(__hpux) || defined(__hpua)
|
|
||||||
# define COMPILER_ID "HP"
|
|
||||||
|
|
||||||
#else /* unknown compiler */
|
|
||||||
# define COMPILER_ID ""
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Construct the string literal in pieces to prevent the source from
|
/* Construct the string literal in pieces to prevent the source from
|
||||||
getting matched. Store it in a pointer rather than an array
|
getting matched. Store it in a pointer rather than an array
|
||||||
|
151
Modules/CMakeCompilerIdDetection.cmake
Normal file
151
Modules/CMakeCompilerIdDetection.cmake
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2014 Stephen Kelly <steveire@gmail.com>
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
function(_readFile file)
|
||||||
|
include(${file})
|
||||||
|
get_filename_component(name ${file} NAME_WE)
|
||||||
|
string(REGEX REPLACE "-.*" "" CompilerId ${name})
|
||||||
|
set(_compiler_id_version_compute_${CompilerId} ${_compiler_id_version_compute} PARENT_SCOPE)
|
||||||
|
set(_compiler_id_pp_test_${CompilerId} ${_compiler_id_pp_test} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
|
||||||
|
|
||||||
|
function(compiler_id_detection outvar lang)
|
||||||
|
|
||||||
|
if (NOT lang STREQUAL Fortran)
|
||||||
|
file(GLOB lang_files
|
||||||
|
"${CMAKE_ROOT}/Modules/Compiler/*-DetermineCompiler.cmake")
|
||||||
|
set(nonlang CXX)
|
||||||
|
if (lang STREQUAL CXX)
|
||||||
|
set(nonlang C)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(GLOB nonlang_files
|
||||||
|
"${CMAKE_ROOT}/Modules/Compiler/*-${nonlang}-DetermineCompiler.cmake")
|
||||||
|
list(REMOVE_ITEM lang_files ${nonlang_files})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(files ${lang_files})
|
||||||
|
if (files)
|
||||||
|
foreach(file ${files})
|
||||||
|
_readFile(${file})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(options ID_STRING VERSION_STRINGS ID_DEFINE PLATFORM_DEFAULT_COMPILER)
|
||||||
|
set(oneValueArgs PREFIX)
|
||||||
|
cmake_parse_arguments(CID "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
if (CID_UNPARSED_ARGUMENTS)
|
||||||
|
message(FATAL_ERROR "Unrecognized arguments: \"${CID_UNPARSED_ARGUMENTS}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Order is relevant here. For example, compilers which pretend to be
|
||||||
|
# GCC must appear before the actual GCC.
|
||||||
|
if (lang STREQUAL CXX)
|
||||||
|
list(APPEND ordered_compilers
|
||||||
|
Comeau
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
list(APPEND ordered_compilers
|
||||||
|
Intel
|
||||||
|
PathScale
|
||||||
|
AppleClang
|
||||||
|
Clang
|
||||||
|
Embarcadero
|
||||||
|
Borland
|
||||||
|
Watcom
|
||||||
|
OpenWatcom
|
||||||
|
SunPro
|
||||||
|
HP
|
||||||
|
Compaq
|
||||||
|
zOS
|
||||||
|
XL
|
||||||
|
VisualAge
|
||||||
|
PGI
|
||||||
|
Cray
|
||||||
|
TI
|
||||||
|
)
|
||||||
|
if (lang STREQUAL C)
|
||||||
|
list(APPEND ordered_compilers
|
||||||
|
TinyCC
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
list(APPEND ordered_compilers
|
||||||
|
SCO
|
||||||
|
GNU
|
||||||
|
MSVC
|
||||||
|
ADSP
|
||||||
|
IAR
|
||||||
|
)
|
||||||
|
if (lang STREQUAL C)
|
||||||
|
list(APPEND ordered_compilers
|
||||||
|
SDCC
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
list(APPEND ordered_compilers
|
||||||
|
MIPSpro)
|
||||||
|
|
||||||
|
if(CID_ID_DEFINE)
|
||||||
|
foreach(Id ${ordered_compilers})
|
||||||
|
set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(pp_if "#if")
|
||||||
|
if (CID_VERSION_STRINGS)
|
||||||
|
set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n/* Version number components: V=Version, R=Revision, P=Patch
|
||||||
|
Version date components: YYYY=Year, MM=Month, DD=Day */\n")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach(Id ${ordered_compilers})
|
||||||
|
if (NOT _compiler_id_pp_test_${Id})
|
||||||
|
message(FATAL_ERROR "No preprocessor test for \"${Id}\"")
|
||||||
|
endif()
|
||||||
|
set(id_content "${pp_if} ${_compiler_id_pp_test_${Id}}\n")
|
||||||
|
if (CID_ID_STRING)
|
||||||
|
set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_ID \"${Id}\"")
|
||||||
|
endif()
|
||||||
|
if (CID_ID_DEFINE)
|
||||||
|
set(id_content "${id_content}# undef ${CID_PREFIX}COMPILER_IS_${Id}\n")
|
||||||
|
set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_IS_${Id} 1\n")
|
||||||
|
endif()
|
||||||
|
if (CID_VERSION_STRINGS)
|
||||||
|
set(PREFIX ${CID_PREFIX})
|
||||||
|
string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY)
|
||||||
|
set(id_content "${id_content}${VERSION_BLOCK}\n")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${id_content}")
|
||||||
|
set(pp_if "#elif")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if (CID_PLATFORM_DEFAULT_COMPILER)
|
||||||
|
set(platform_compiler_detection "
|
||||||
|
/* These compilers are either not known or too old to define an
|
||||||
|
identification macro. Try to identify the platform and guess that
|
||||||
|
it is the native compiler. */
|
||||||
|
#elif defined(__sgi)
|
||||||
|
# define ${CID_PREFIX}COMPILER_ID \"MIPSpro\"
|
||||||
|
|
||||||
|
#elif defined(__hpux) || defined(__hpua)
|
||||||
|
# define ${CID_PREFIX}COMPILER_ID \"HP\"
|
||||||
|
|
||||||
|
#else /* unknown compiler */
|
||||||
|
# define ${CID_PREFIX}COMPILER_ID \"\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${platform_compiler_detection}\n#endif")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${outvar} ${CMAKE_${lang}_COMPILER_ID_CONTENT} PARENT_SCOPE)
|
||||||
|
endfunction()
|
@ -97,11 +97,20 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
|||||||
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
|
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
include(CMakeCompilerIdDetection)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Function to write the compiler id source file.
|
# Function to write the compiler id source file.
|
||||||
function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
|
function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
|
||||||
find_file(src_in ${src}.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
find_file(src_in ${src}.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||||
file(READ ${src_in} ID_CONTENT_IN)
|
file(READ ${src_in} ID_CONTENT_IN)
|
||||||
|
|
||||||
|
compiler_id_detection(CMAKE_${lang}_COMPILER_ID_CONTENT ${lang}
|
||||||
|
ID_STRING
|
||||||
|
VERSION_STRINGS
|
||||||
|
PLATFORM_DEFAULT_COMPILER
|
||||||
|
)
|
||||||
|
|
||||||
unset(src_in CACHE)
|
unset(src_in CACHE)
|
||||||
string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
|
string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
|
||||||
file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
|
file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
|
||||||
|
10
Modules/Compiler/ADSP-DetermineCompiler.cmake
Normal file
10
Modules/Compiler/ADSP-DetermineCompiler.cmake
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
#if defined(__VISUALDSPVERSION__)
|
||||||
|
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
||||||
|
#endif")
|
7
Modules/Compiler/AppleClang-DetermineCompiler.cmake
Normal file
7
Modules/Compiler/AppleClang-DetermineCompiler.cmake
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__clang__) && defined(__apple_build_version__)")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "${_compiler_id_version_compute}
|
||||||
|
# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__apple_build_version__)")
|
7
Modules/Compiler/Borland-DetermineCompiler.cmake
Normal file
7
Modules/Compiler/Borland-DetermineCompiler.cmake
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__BORLANDC__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __BORLANDC__ = 0xVRR */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)")
|
4
Modules/Compiler/Clang-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/Clang-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__clang__)")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
|
11
Modules/Compiler/Clang-DetermineCompilerInternal.cmake
Normal file
11
Modules/Compiler/Clang-DetermineCompilerInternal.cmake
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define @PREFIX@SIMULATE_ID \"MSVC\"
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif")
|
7
Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake
Normal file
7
Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__COMO__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __COMO_VERSION__ = VRR */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)")
|
8
Modules/Compiler/Compaq-C-DetermineCompiler.cmake
Normal file
8
Modules/Compiler/Compaq-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__DECC)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __DECC_VER = VVRRTPPPP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)")
|
8
Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake
Normal file
8
Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__DECCXX)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __DECCXX_VER = VVRRTPPPP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)")
|
6
Modules/Compiler/Cray-DetermineCompiler.cmake
Normal file
6
Modules/Compiler/Cray-DetermineCompiler.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(_CRAYC)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_RELEASE)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)")
|
7
Modules/Compiler/Embarcadero-DetermineCompiler.cmake
Normal file
7
Modules/Compiler/Embarcadero-DetermineCompiler.cmake
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)")
|
9
Modules/Compiler/GNU-DetermineCompiler.cmake
Normal file
9
Modules/Compiler/GNU-DetermineCompiler.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__GNUC__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
# if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
# endif")
|
8
Modules/Compiler/HP-C-DetermineCompiler.cmake
Normal file
8
Modules/Compiler/HP-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__HP_cc)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __HP_cc = VVRRPP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__HP_cc % 100)")
|
8
Modules/Compiler/HP-CXX-DetermineCompiler.cmake
Normal file
8
Modules/Compiler/HP-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__HP_aCC)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __HP_aCC = VVRRPP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)")
|
4
Modules/Compiler/IAR-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/IAR-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
# IAR Systems compiler for embedded systems.
|
||||||
|
# http://www.iar.com
|
||||||
|
set(_compiler_id_pp_test "defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)")
|
6
Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
Normal file
6
Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __IBMC__ = VRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)")
|
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __IBMCPP__ = VRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)")
|
22
Modules/Compiler/Intel-DetermineCompiler.cmake
Normal file
22
Modules/Compiler/Intel-DetermineCompiler.cmake
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__INTEL_COMPILER) || defined(__ICC)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __INTEL_COMPILER = VRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||||
|
# if defined(__INTEL_COMPILER_UPDATE)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||||
|
# else
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||||
|
# endif
|
||||||
|
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||||
|
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||||
|
# endif
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define @PREFIX@SIMULATE_ID \"MSVC\"
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif")
|
15
Modules/Compiler/MIPSpro-DetermineCompiler.cmake
Normal file
15
Modules/Compiler/MIPSpro-DetermineCompiler.cmake
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# if defined(_SGI_COMPILER_VERSION)
|
||||||
|
/* _SGI_COMPILER_VERSION = VRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
|
||||||
|
# else
|
||||||
|
/* _COMPILER_VERSION = VRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
|
||||||
|
# endif")
|
19
Modules/Compiler/MSVC-DetermineCompiler.cmake
Normal file
19
Modules/Compiler/MSVC-DetermineCompiler.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(_MSC_VER)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# if defined(_MSC_FULL_VER)
|
||||||
|
# if _MSC_VER >= 1400
|
||||||
|
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||||
|
# else
|
||||||
|
/* _MSC_FULL_VER = VVRRPPPP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# if defined(_MSC_BUILD)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||||
|
# endif")
|
10
Modules/Compiler/OpenWatcom-DetermineCompiler.cmake
Normal file
10
Modules/Compiler/OpenWatcom-DetermineCompiler.cmake
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__WATCOMC__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __WATCOMC__ = VVRP + 1100 */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||||
|
# if (__WATCOMC__ % 10) > 0
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||||
|
# endif")
|
9
Modules/Compiler/PGI-DetermineCompiler.cmake
Normal file
9
Modules/Compiler/PGI-DetermineCompiler.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__PGI)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||||
|
# if defined(__PGIC_PATCHLEVEL__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||||
|
# endif")
|
9
Modules/Compiler/PathScale-DetermineCompiler.cmake
Normal file
9
Modules/Compiler/PathScale-DetermineCompiler.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__PATHCC__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||||
|
# if defined(__PATHCC_PATCHLEVEL__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||||
|
# endif")
|
2
Modules/Compiler/SCO-DetermineCompiler.cmake
Normal file
2
Modules/Compiler/SCO-DetermineCompiler.cmake
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__SCO_VERSION__)")
|
10
Modules/Compiler/SDCC-C-DetermineCompiler.cmake
Normal file
10
Modules/Compiler/SDCC-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# sdcc, the small devices C compiler for embedded systems,
|
||||||
|
# http://sdcc.sourceforge.net */
|
||||||
|
set(_compiler_id_pp_test "defined(SDCC)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* SDCC = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)")
|
15
Modules/Compiler/SunPro-C-DetermineCompiler.cmake
Normal file
15
Modules/Compiler/SunPro-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__SUNPRO_C)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# if __SUNPRO_C >= 0x5100
|
||||||
|
/* __SUNPRO_C = 0xVRRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||||
|
# else
|
||||||
|
/* __SUNPRO_CC = 0xVRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||||
|
# endif")
|
15
Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake
Normal file
15
Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__SUNPRO_CC)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# if __SUNPRO_CC >= 0x5100
|
||||||
|
/* __SUNPRO_CC = 0xVRRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||||
|
# else
|
||||||
|
/* __SUNPRO_CC = 0xVRP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||||
|
# endif")
|
8
Modules/Compiler/TI-DetermineCompiler.cmake
Normal file
8
Modules/Compiler/TI-DetermineCompiler.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__TI_COMPILER_VERSION__)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)")
|
2
Modules/Compiler/TinyCC-C-DetermineCompiler.cmake
Normal file
2
Modules/Compiler/TinyCC-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__TINYC__)")
|
4
Modules/Compiler/VisualAge-C-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/VisualAge-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-C-DetermineVersionInternal.cmake")
|
4
Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-CXX-DetermineVersionInternal.cmake")
|
10
Modules/Compiler/Watcom-DetermineCompiler.cmake
Normal file
10
Modules/Compiler/Watcom-DetermineCompiler.cmake
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__WATCOMC__) && __WATCOMC__ < 1200")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
/* __WATCOMC__ = VVRR */
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||||
|
# if (__WATCOMC__ % 10) > 0
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||||
|
# endif")
|
4
Modules/Compiler/XL-C-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/XL-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-C-DetermineVersionInternal.cmake")
|
4
Modules/Compiler/XL-CXX-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/XL-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-CXX-DetermineVersionInternal.cmake")
|
4
Modules/Compiler/zOS-C-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/zOS-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__IBMC__) && defined(__COMPILER_VER__)")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-C-DetermineVersionInternal.cmake")
|
4
Modules/Compiler/zOS-CXX-DetermineCompiler.cmake
Normal file
4
Modules/Compiler/zOS-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__IBMCPP__) && defined(__COMPILER_VER__)")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-CXX-DetermineVersionInternal.cmake")
|
Loading…
x
Reference in New Issue
Block a user