summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompilerId.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-04-28 13:35:01 (GMT)
committerBrad King <brad.king@kitware.com>2007-04-28 13:35:01 (GMT)
commiteac71647ddab0eb52fe3ab20062519f7693ce44d (patch)
tree865fa99dea2700f89530783c6114b5ec64fc8490 /Modules/CMakeCCompilerId.c
parentbceb1532c665bac669f53a0f364dad920058017e (diff)
downloadCMake-eac71647ddab0eb52fe3ab20062519f7693ce44d.zip
CMake-eac71647ddab0eb52fe3ab20062519f7693ce44d.tar.gz
CMake-eac71647ddab0eb52fe3ab20062519f7693ce44d.tar.bz2
ENH: Merging CompilerId implementation from branch CMake-Modules-CompilerId to the main tree. Changes between CMake-Modules-CompilerId-bp and CMake-Modules-CompilerId-mp1 are included.
Diffstat (limited to 'Modules/CMakeCCompilerId.c')
-rw-r--r--Modules/CMakeCCompilerId.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/Modules/CMakeCCompilerId.c b/Modules/CMakeCCompilerId.c
new file mode 100644
index 0000000..08a4128
--- /dev/null
+++ b/Modules/CMakeCCompilerId.c
@@ -0,0 +1,51 @@
+#ifdef __cplusplus
+# error "A C++ compiler has been selected for C."
+#endif
+
+#ifdef __CLASSIC_C__
+# define const
+#endif
+
+static char const info_compiler[] = "INFO:compiler["
+#if defined(__INTEL_COMPILER) || defined(__ICC)
+"Intel"
+#elif defined(__BORLANDC__)
+"Borland"
+#elif defined(__WATCOMC__)
+"Watcom"
+#elif defined(__SUNPRO_C)
+"SunPro"
+#elif defined(__HP_cc)
+"HP"
+#elif defined(__DECC)
+"Compaq"
+#elif defined(__IBMC__)
+"VisualAge"
+#elif defined(__GNUC__)
+"GNUC"
+#elif defined(_MSC_VER)
+"MSVC"
+#elif defined(_COMPILER_VERSION)
+"MIPSpro"
+
+/* This compiler is either not known or is too old to define an
+ identification macro. Try to identify the platform and guess that
+ it is the native compiler. */
+#elif defined(__sgi)
+"MIPSpro"
+#elif defined(__hpux) || defined(__hpua)
+"HP"
+
+#else /* unknown compiler */
+""
+#endif
+"]";
+
+/* Include the platform identification source. */
+#include "CMakePlatformId.h"
+
+/* Make sure the information strings are referenced. */
+int main()
+{
+ return ((int)&info_compiler) + ((int)&info_platform);
+}