[Orxonox-commit 968] r5691 - in code/branches/resource2: . cmake src

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Aug 29 22:05:55 CEST 2009


Author: rgrieder
Date: 2009-08-29 22:05:55 +0200 (Sat, 29 Aug 2009)
New Revision: 5691

Modified:
   code/branches/resource2/CMakeLists.txt
   code/branches/resource2/cmake/CompilerConfigMSVC.cmake
   code/branches/resource2/src/OrxonoxConfig.cmake
Log:
Enable link time code generation for visual studio if ORXONOX_RELEASE is enabled. This creates slightly faster and especially much less (about half) code.

Modified: code/branches/resource2/CMakeLists.txt
===================================================================
--- code/branches/resource2/CMakeLists.txt	2009-08-29 20:04:43 UTC (rev 5690)
+++ code/branches/resource2/CMakeLists.txt	2009-08-29 20:05:55 UTC (rev 5691)
@@ -88,6 +88,9 @@
   MARK_AS_ADVANCED(CMAKE_BUILD_TYPE)
 ENDIF()
 
+# Enable expensive optimisations: use this for a binary release build
+OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
+
 ########### Subfolders and Subscripts ###########
 
 # Library finding

Modified: code/branches/resource2/cmake/CompilerConfigMSVC.cmake
===================================================================
--- code/branches/resource2/cmake/CompilerConfigMSVC.cmake	2009-08-29 20:04:43 UTC (rev 5690)
+++ code/branches/resource2/cmake/CompilerConfigMSVC.cmake	2009-08-29 20:05:55 UTC (rev 5691)
@@ -74,13 +74,10 @@
 SET_COMPILER_FLAGS("-MD  -O2 -Zi -DNDEBUG -MP2"      RelWithDebInfo CACHE)
 SET_COMPILER_FLAGS("-MD  -O1     -DNDEBUG -MP2"      MinSizeRel     CACHE)
 
-# Microsoft unfortunately couldn't integrate a fix issued while VS 2008 beta 2
-# was being tested into the final release even though a fix existed...
-# And it's actually quite a big issue, you simple can't compile anything.
-# Fortunately for us, disabling Minimal Rebuild solves the problem.
-REMOVE_COMPILER_FLAGS("-Gm" Debug MSVC09 CACHE)
-# And since we have to remove /Gm, let's add /MP2 to speed things up
-ADD_COMPILER_FLAGS("-MP2" Debug MSVC09 CACHE)
+# Use Link time code generation for Release config if ORXONOX_RELEASE is defined
+IF(ORXONOX_RELEASE)
+  ADD_COMPILER_FLAGS("-GL" ReleaseAll CACHE)
+ENDIF()
 
 
 ####################### Warnings ########################
@@ -148,3 +145,8 @@
 # and INCREMENTAL and DEBUG for debug versions
 ADD_LINKER_FLAGS("-OPT:REF -OPT:ICF" Release MinSizeRel CACHE)
 ADD_LINKER_FLAGS("-OPT:NOWIN98" MSVC80 CACHE)
+
+# Use Link time code generation for Release config if ORXONOX_RELEASE is defined
+IF(ORXONOX_RELEASE)
+  ADD_LINKER_FLAGS("-LTCG" ReleaseAll CACHE)
+ENDIF()

Modified: code/branches/resource2/src/OrxonoxConfig.cmake
===================================================================
--- code/branches/resource2/src/OrxonoxConfig.cmake	2009-08-29 20:04:43 UTC (rev 5690)
+++ code/branches/resource2/src/OrxonoxConfig.cmake	2009-08-29 20:05:55 UTC (rev 5691)
@@ -38,9 +38,6 @@
   OPTION(PCH_ENABLE "Global PCH switch" TRUE)
 ENDIF()
 
-# Enable expensive optimisations: use this for a binary release build
-OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
-
 # Use WinMain() or main()?
 IF(WIN32)
   OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)




More information about the Orxonox-commit mailing list