[Orxonox-commit 3975] r8649 - code/branches/unity_build/cmake/tools

rgrieder at orxonox.net rgrieder at orxonox.net
Sat May 28 21:56:51 CEST 2011


Author: rgrieder
Date: 2011-05-28 21:56:50 +0200 (Sat, 28 May 2011)
New Revision: 8649

Modified:
   code/branches/unity_build/cmake/tools/BuildUnits.cmake
   code/branches/unity_build/cmake/tools/TargetUtilities.cmake
Log:
Added EXCLUDE_FROM_BUILD_UNITS to the ADD_TARGET commands and implemented it's effects.

Modified: code/branches/unity_build/cmake/tools/BuildUnits.cmake
===================================================================
--- code/branches/unity_build/cmake/tools/BuildUnits.cmake	2011-05-28 18:53:14 UTC (rev 8648)
+++ code/branches/unity_build/cmake/tools/BuildUnits.cmake	2011-05-28 19:56:50 UTC (rev 8649)
@@ -30,8 +30,9 @@
     # Only look at C++ source files
     IF(_file MATCHES "\\.(cpp|cc|cxx)$")
       # Some files might be marked as not to compile at all
-      GET_SOURCE_FILE_PROPERTY(_skip ${_file} HEADER_FILE_ONLY)
-      IF(NOT _skip)
+      GET_SOURCE_FILE_PROPERTY(_skip1 ${_file} HEADER_FILE_ONLY)
+      GET_SOURCE_FILE_PROPERTY(_skip2 ${_file} EXCLUDE_FROM_BUILD_UNITS)
+      IF(NOT _skip1 AND NOT _skip2)
         GET_SOURCE_FILE_PROPERTY(_size ${_file} BUILD_UNIT_SIZE)
         IF(NOT _size)
           SET(_size 1)

Modified: code/branches/unity_build/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/unity_build/cmake/tools/TargetUtilities.cmake	2011-05-28 18:53:14 UTC (rev 8648)
+++ code/branches/unity_build/cmake/tools/TargetUtilities.cmake	2011-05-28 19:56:50 UTC (rev 8649)
@@ -53,6 +53,9 @@
  #      PCH_FILE:          Precompiled header file
  #      PCH_EXCLUDE:       Source files to be excluded from PCH support
  #      OUTPUT_NAME:       If you want a different name than the target name
+ #      EXCLUDE_FROM_BUILD_UNITS: Specifies files that are not put into
+ #                         automatic (full) build units. They can still
+ #                         explicitely be included in a BUILD_UNIT (partial)
  #  Note:
  #    This function also installs the target!
  #  Prerequisistes:
@@ -91,7 +94,8 @@
   SET(_list_names LINK_LIBRARIES     VERSION           SOURCE_FILES
                   DEFINE_SYMBOL      TOLUA_FILES       PCH_FILE
                   PCH_EXCLUDE        OUTPUT_NAME       LINK_LIBS_LINUX
-                  LINK_LIBS_WIN32    LINK_LIBS_APPLE   LINK_LIBS_UNIX)
+                  LINK_LIBS_WIN32    LINK_LIBS_APPLE   LINK_LIBS_UNIX
+                  EXCLUDE_FROM_BUILD_UNITS)
 
   PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN})
 
@@ -177,6 +181,12 @@
   # Remove potential duplicates
   LIST(REMOVE_DUPLICATES _${_target_name}_files)
 
+  # Mark files to be excluded from build units
+  IF(_arg_EXCLUDE_FROM_BUILD_UNITS)
+    SET_SOURCE_FILES_PROPERTIES(${_arg_EXCLUDE_FROM_BUILD_UNITS}
+      PROPERTIES EXCLUDE_FROM_BUILD_UNITS TRUE)
+  ENDIF()
+
   # Full build units
   IF(NOT _arg_ORXONOX_EXTERNAL AND ENABLE_BUILD_UNITS MATCHES "full")
     GENERATE_BUILD_UNITS(${_target_name} _${_target_name}_files)




More information about the Orxonox-commit mailing list