[cmake-commits] hoffman committed CMakeCCompilerId.c 1.3 1.4 CMakeCXXCompilerId.cpp 1.5 1.6 CMakeDetermineCompilerId.cmake 1.4 1.5

cmake-commits at cmake.org cmake-commits at cmake.org
Thu May 17 10:07:53 EDT 2007


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv14511/Modules

Modified Files:
	CMakeCCompilerId.c CMakeCXXCompilerId.cpp 
	CMakeDetermineCompilerId.cmake 
Log Message:
ENH: fix up compiler id to be more robust


Index: CMakeCCompilerId.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCCompilerId.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CMakeCCompilerId.c	1 May 2007 18:35:55 -0000	1.3
+++ CMakeCCompilerId.c	17 May 2007 14:07:51 -0000	1.4
@@ -47,5 +47,5 @@
 /* Make sure the information strings are referenced.  */
 int main()
 {
-  return ((int)&info_compiler) + ((int)&info_platform);
+  return (&info_compiler[0] != &info_platform[0]);
 }

Index: CMakeDetermineCompilerId.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCompilerId.cmake,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CMakeDetermineCompilerId.cmake	3 May 2007 12:24:32 -0000	1.4
+++ CMakeDetermineCompilerId.cmake	17 May 2007 14:07:51 -0000	1.5
@@ -53,6 +53,10 @@
       "${CMAKE_${lang}_COMPILER_ID_SRC}\" failed with the following output:\n"
       "${CMAKE_${lang}_COMPILER_ID_RESULT}\n"
       "${CMAKE_${lang}_COMPILER_ID_OUTPUT}\n\n")
+    MESSAGE(FATAL_ERROR "Compiling the ${lang} compiler identification source file \""
+      "${CMAKE_${lang}_COMPILER_ID_SRC}\" failed with the following output:\n"
+      "${CMAKE_${lang}_COMPILER_ID_RESULT}\n"
+      "${CMAKE_${lang}_COMPILER_ID_OUTPUT}\n\n")
   ELSE(CMAKE_${lang}_COMPILER_ID_RESULT)
     # Compilation succeeded.
     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -110,5 +114,12 @@
         "${CMAKE_${lang}_COMPILER_ID_DIR} "
         "with a name known to CMake.\n\n")
     ENDIF(CMAKE_${lang}_COMPILER_ID_EXE)
+
+    IF(CMAKE_${lang}_COMPILER_ID)
+      MESSAGE(STATUS "The ${lang} compiler identification is "
+        "${CMAKE_${lang}_COMPILER_ID}")
+    ELSE(CMAKE_${lang}_COMPILER_ID)
+      MESSAGE(STATUS "The ${lang} compiler identification is unknown")
+    ENDIF(CMAKE_${lang}_COMPILER_ID)
   ENDIF(CMAKE_${lang}_COMPILER_ID_RESULT)
 ENDMACRO(CMAKE_DETERMINE_COMPILER_ID)

Index: CMakeCXXCompilerId.cpp
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCXXCompilerId.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CMakeCXXCompilerId.cpp	17 May 2007 12:38:07 -0000	1.5
+++ CMakeCXXCompilerId.cpp	17 May 2007 14:07:51 -0000	1.6
@@ -48,9 +48,5 @@
 /* Make sure the information strings are referenced.  */
 int main()
 {
-  if(&info_compiler[0] != &info_platform[0])
-    {
-    return 1;
-    }
-  return 0;
+  return (&info_compiler[0] != &info_platform[0]);
 }



More information about the Cmake-commits mailing list