[Orxonox-commit 3895] r8569 - in code/branches/unity_build: cmake/tools src
rgrieder at orxonox.net
rgrieder at orxonox.net
Wed May 25 02:20:29 CEST 2011
Author: rgrieder
Date: 2011-05-25 02:20:29 +0200 (Wed, 25 May 2011)
New Revision: 8569
Modified:
code/branches/unity_build/cmake/tools/TargetUtilities.cmake
code/branches/unity_build/src/CMakeLists.txt
code/branches/unity_build/src/OrxonoxConfig.cmake
Log:
Changed binary CMake option DISABLE_BUILD_UNITS to string option ENABLE_BUILD_UNITS with the following possible values:
off/false: Turn off completely
partial: Only combine files explicitly specified with BUILD_UNIT
full##: Use ## source files per orxonox library and use manual build units
for external dependencies. Example: full8 will in general use 8
source files per library, but more specifically tries to occupy
8 CPU threads.
Modified: code/branches/unity_build/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/unity_build/cmake/tools/TargetUtilities.cmake 2011-05-24 20:41:43 UTC (rev 8568)
+++ code/branches/unity_build/cmake/tools/TargetUtilities.cmake 2011-05-25 00:20:29 UTC (rev 8569)
@@ -108,7 +108,7 @@
IF(NOT _build_unit_file)
MESSAGE(FATAL_ERROR "No name provided for build unit")
ENDIF()
- IF(NOT DISABLE_BUILD_UNITS)
+ IF(ENABLE_BUILD_UNITS)
IF(NOT _build_unit_include_string)
MESSAGE(STATUS "Warning: Empty build unit!")
ENDIF()
@@ -146,7 +146,7 @@
LIST(APPEND _${_target_name}_source_files ${_file})
# Handle build units
- IF(_add_to_build_unit AND NOT DISABLE_BUILD_UNITS)
+ IF(_add_to_build_unit AND ENABLE_BUILD_UNITS)
IF(_file MATCHES "\\.(c|cc|cpp|cxx)$")
SET(_build_unit_include_string "${_build_unit_include_string}#include \"${_file}\"\n")
ENDIF()
Modified: code/branches/unity_build/src/CMakeLists.txt
===================================================================
--- code/branches/unity_build/src/CMakeLists.txt 2011-05-24 20:41:43 UTC (rev 8568)
+++ code/branches/unity_build/src/CMakeLists.txt 2011-05-25 00:20:29 UTC (rev 8569)
@@ -65,7 +65,7 @@
REMOVE_LINKER_FLAGS("-INCREMENTAL:YES" Debug)
ADD_LINKER_FLAGS ("-INCREMENTAL:NO" Debug)
ENDIF()
- IF(NOT DISABLE_BUILD_UNITS)
+ IF(ENABLE_BUILD_UNITS)
# Build units seem to generate 'memory leaks' with static variables
MESSAGE("Warning: You should disable build units when using VLD!")
ENDIF()
Modified: code/branches/unity_build/src/OrxonoxConfig.cmake
===================================================================
--- code/branches/unity_build/src/OrxonoxConfig.cmake 2011-05-24 20:41:43 UTC (rev 8568)
+++ code/branches/unity_build/src/OrxonoxConfig.cmake 2011-05-25 00:20:29 UTC (rev 8569)
@@ -33,8 +33,18 @@
OPTION(PCH_ENABLE "Global PCH switch" TRUE)
ENDIF()
-# Global switch to disable multiple file compilations
-OPTION(DISABLE_BUILD_UNITS "Disables building multiple source files as one." FALSE)
+# Global option to steer building muliple files as a single one
+# off/false: Turn off completely
+# partial: Only combine files explicitly specified with BUILD_UNIT
+# full##: Use ## source files per orxonox library and use manual build units
+# for external dependencies. Example: full8 will in general use 8
+# source files per library, but more specifically tries to occupy
+# 8 CPU threads.
+# This is configured manually in BuildUnitsConfig.cmake
+SET(ENABLE_BUILD_UNITS "partial" CACHE STRING "Enables building multiple source files as one.")
+IF(ENABLE_BUILD_UNITS)
+ INCLUDE(BuildUnitsConfig.cmake)
+ENDIF()
# Use WinMain() or main()?
IF(WIN32)
More information about the Orxonox-commit
mailing list