Basic Image AlgorithmS Library 2.8.0

CMakeCXXCompilerId.cpp

00001 /* This source file must have a .cpp extension so that all C++ compilers
00002    recognize the extension without flags.  Borland does not know .cxx for
00003    example.  */
00004 #ifndef __cplusplus
00005 # error "A C compiler has been selected for C++."
00006 #endif
00007 
00008 #if defined(__COMO__)
00009 # define COMPILER_ID "Comeau"
00010 
00011 #elif defined(__INTEL_COMPILER) || defined(__ICC)
00012 # define COMPILER_ID "Intel"
00013 
00014 #elif defined(__clang__)
00015 # define COMPILER_ID "Clang"
00016 
00017 #elif defined(__BORLANDC__)
00018 # define COMPILER_ID "Borland"
00019 
00020 #elif defined(__WATCOMC__)
00021 # define COMPILER_ID "Watcom"
00022 
00023 #elif defined(__SUNPRO_CC)
00024 # define COMPILER_ID "SunPro"
00025 
00026 #elif defined(__HP_aCC)
00027 # define COMPILER_ID "HP"
00028 
00029 #elif defined(__DECCXX)
00030 # define COMPILER_ID "Compaq"
00031 
00032 #elif defined(__IBMCPP__)
00033 # if defined(__COMPILER_VER__)
00034 #  define COMPILER_ID "zOS"
00035 # elif __IBMCPP__ >= 800
00036 #  define COMPILER_ID "XL"
00037 # else
00038 #  define COMPILER_ID "VisualAge"
00039 # endif
00040 
00041 #elif defined(__PGI)
00042 # define COMPILER_ID "PGI"
00043 
00044 #elif defined(__PATHSCALE__)
00045 # define COMPILER_ID "PathScale"
00046 
00047 #elif defined(__GNUC__)
00048 # define COMPILER_ID "GNU"
00049 
00050 #elif defined(_MSC_VER)
00051 # define COMPILER_ID "MSVC"
00052 
00053 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
00054 /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
00055    SHARC (21000) DSPs */
00056 # define COMPILER_ID "ADSP"
00057 
00058 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
00059 # define COMPILER_ID "MIPSpro"
00060 
00061 /* This compiler is either not known or is too old to define an
00062    identification macro.  Try to identify the platform and guess that
00063    it is the native compiler.  */
00064 #elif defined(__sgi)
00065 # define COMPILER_ID "MIPSpro"
00066 
00067 #elif defined(__hpux) || defined(__hpua)
00068 # define COMPILER_ID "HP"
00069 
00070 #else /* unknown compiler */
00071 # define COMPILER_ID ""
00072 
00073 #endif
00074 
00075 /* Construct the string literal in pieces to prevent the source from
00076    getting matched.  Store it in a pointer rather than an array
00077    because some compilers will just produce instructions to fill the
00078    array rather than assigning a pointer to a static array.  */
00079 char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
00080 
00081 /* Identify known platforms by name.  */
00082 #if defined(__linux) || defined(__linux__) || defined(linux)
00083 # define PLATFORM_ID "Linux"
00084 
00085 #elif defined(__CYGWIN__)
00086 # define PLATFORM_ID "Cygwin"
00087 
00088 #elif defined(__MINGW32__)
00089 # define PLATFORM_ID "MinGW"
00090 
00091 #elif defined(__APPLE__)
00092 # define PLATFORM_ID "Darwin"
00093 
00094 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
00095 # define PLATFORM_ID "Windows"
00096 
00097 #elif defined(__FreeBSD__) || defined(__FreeBSD)
00098 # define PLATFORM_ID "FreeBSD"
00099 
00100 #elif defined(__NetBSD__) || defined(__NetBSD)
00101 # define PLATFORM_ID "NetBSD"
00102 
00103 #elif defined(__OpenBSD__) || defined(__OPENBSD)
00104 # define PLATFORM_ID "OpenBSD"
00105 
00106 #elif defined(__sun) || defined(sun)
00107 # define PLATFORM_ID "SunOS"
00108 
00109 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
00110 # define PLATFORM_ID "AIX"
00111 
00112 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
00113 # define PLATFORM_ID "IRIX"
00114 
00115 #elif defined(__hpux) || defined(__hpux__)
00116 # define PLATFORM_ID "HP-UX"
00117 
00118 #elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
00119 # define PLATFORM_ID "Haiku"
00120 /* Haiku also defines __BEOS__ so we must 
00121    put it prior to the check for __BEOS__
00122 */
00123 
00124 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
00125 # define PLATFORM_ID "BeOS"
00126 
00127 #elif defined(__QNX__) || defined(__QNXNTO__)
00128 # define PLATFORM_ID "QNX"
00129 
00130 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
00131 # define PLATFORM_ID "Tru64"
00132 
00133 #elif defined(__riscos) || defined(__riscos__)
00134 # define PLATFORM_ID "RISCos"
00135 
00136 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
00137 # define PLATFORM_ID "SINIX"
00138 
00139 #elif defined(__UNIX_SV__)
00140 # define PLATFORM_ID "UNIX_SV"
00141 
00142 #elif defined(__bsdos__)
00143 # define PLATFORM_ID "BSDOS"
00144 
00145 #elif defined(_MPRAS) || defined(MPRAS)
00146 # define PLATFORM_ID "MP-RAS"
00147 
00148 #elif defined(__osf) || defined(__osf__)
00149 # define PLATFORM_ID "OSF1"
00150 
00151 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
00152 # define PLATFORM_ID "SCO_SV"
00153 
00154 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
00155 # define PLATFORM_ID "ULTRIX"
00156 
00157 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
00158 # define PLATFORM_ID "Xenix"
00159 
00160 #else /* unknown platform */
00161 # define PLATFORM_ID ""
00162 
00163 #endif
00164 
00165 /* For windows compilers MSVC and Intel we can determine
00166    the architecture of the compiler being used.  This is becase
00167    the compilers do not have flags that can change the architecture,
00168    but rather depend on which compiler is being used
00169 */
00170 #if defined(_WIN32) && defined(_MSC_VER)
00171 # if defined(_M_IA64)
00172 #  define ARCHITECTURE_ID "IA64"
00173 
00174 # elif defined(_M_X64) || defined(_M_AMD64)
00175 #  define ARCHITECTURE_ID "x64" 
00176 
00177 # elif defined(_M_IX86)
00178 #  define ARCHITECTURE_ID "X86"
00179 
00180 # else /* unknown architecture */
00181 #  define ARCHITECTURE_ID ""
00182 # endif
00183 
00184 #else
00185 #  define ARCHITECTURE_ID ""
00186 #endif
00187 
00188 /* Construct the string literal in pieces to prevent the source from
00189    getting matched.  Store it in a pointer rather than an array
00190    because some compilers will just produce instructions to fill the
00191    array rather than assigning a pointer to a static array.  */
00192 char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
00193 char* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
00194 
00195 
00196 
00197 /*--------------------------------------------------------------------------*/
00198 
00199 int main(int argc, char* argv[])
00200 {
00201   int require = 0;
00202   require += info_compiler[argc];
00203   require += info_platform[argc];
00204   (void)argv;
00205   return require;
00206 }
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends