[Orxonox-commit 4003] r8677 - in code/branches/unity_build: cmake src

rgrieder at orxonox.net rgrieder at orxonox.net
Mon May 30 00:31:29 CEST 2011


Author: rgrieder
Date: 2011-05-30 00:31:28 +0200 (Mon, 30 May 2011)
New Revision: 8677

Modified:
   code/branches/unity_build/cmake/CompilerConfigGCC.cmake
   code/branches/unity_build/cmake/CompilerConfigMSVC.cmake
   code/branches/unity_build/src/OrxonoxConfig.cmake
Log:
The __COUNTER__ macro required for full build units was only added in GCC 4.3.
Warn the developer if using GCC < 4.3 and full build units.

Modified: code/branches/unity_build/cmake/CompilerConfigGCC.cmake
===================================================================
--- code/branches/unity_build/cmake/CompilerConfigGCC.cmake	2011-05-29 22:22:19 UTC (rev 8676)
+++ code/branches/unity_build/cmake/CompilerConfigGCC.cmake	2011-05-29 22:31:28 UTC (rev 8677)
@@ -44,6 +44,13 @@
   SET(PCH_COMPILER_SUPPORT TRUE)
 ENDIF()
 
+# __COUNTER__ macro was only added in GCC 4.3
+# It might be required to make full build units work
+COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.3.0" _compare_result)
+IF(_compare_result GREATER -1)
+  SET(HAVE_COUNTER_MACRO TRUE)
+ENDIF()
+
 # Also include environment flags. Could cause conflicts though
 SET_COMPILER_FLAGS("$ENV{CXXFLAGS}" CXX CACHE)
 SET_COMPILER_FLAGS("$ENV{CFLAGS}"   C   CACHE)

Modified: code/branches/unity_build/cmake/CompilerConfigMSVC.cmake
===================================================================
--- code/branches/unity_build/cmake/CompilerConfigMSVC.cmake	2011-05-29 22:22:19 UTC (rev 8676)
+++ code/branches/unity_build/cmake/CompilerConfigMSVC.cmake	2011-05-29 22:31:28 UTC (rev 8677)
@@ -33,7 +33,11 @@
 # Orxonox only supports MSVC 8 and above, which gets asserted above
 SET(PCH_COMPILER_SUPPORT TRUE)
 
+# __COUNTER__ macro has been around since VS 2005
+# It might be required to make full build units work
+SET(HAVE_COUNTER_MACRO TRUE)
 
+
 #################### Compiler Flags #####################
 
 # CMake default flags : -DWIN32 -D_WINDOWS -W3 -Zm1000

Modified: code/branches/unity_build/src/OrxonoxConfig.cmake
===================================================================
--- code/branches/unity_build/src/OrxonoxConfig.cmake	2011-05-29 22:22:19 UTC (rev 8676)
+++ code/branches/unity_build/src/OrxonoxConfig.cmake	2011-05-29 22:31:28 UTC (rev 8677)
@@ -49,6 +49,9 @@
       MESSAGE(FATAL_ERROR "Unrecognised option for ENABLE_BUILD_UNITS: ${ENABLE_BUILD_UNITS}")
     ELSE()
       SET(NR_OF_BUILD_UNITS ${_nr_of_units})
+      IF(NOT HAVE_COUNTER_MACRO)
+        MESSAGE(WARNING "Your compiler doesn't support the __COUNTER__ macro. Full build units might not work!")
+      ENDIF()
     ENDIF()
   ENDIF()
   IF(CMAKE_COMPILER_IS_GNU)




More information about the Orxonox-commit mailing list