- Timestamp:
- May 27, 2011, 5:38:43 AM (13 years ago)
- Location:
- code/branches/unity_build
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/unity_build/cmake/tools/TargetUtilities.cmake
r8569 r8622 62 62 # 63 63 64 INCLUDE(BuildUnits) 64 65 INCLUDE(CMakeDependentOption) 65 66 INCLUDE(CapitaliseName) … … 120 121 ENDIF() 121 122 LIST(APPEND _${_target_name}_source_files ${_build_unit_file}) 123 LIST(APPEND _${_target_name}_build_units ${_build_unit_file}) 124 # Store the number of files included. May be used for full build units. 125 SET_SOURCE_FILES_PROPERTIES(${_build_unit_file} 126 PROPERTIES BUILD_UNIT_SIZE "${_build_unit_count}") 122 127 ENDIF() 123 128 SET(_add_to_build_unit FALSE) 124 129 ELSEIF(_get_build_unit_file) 130 # Note: ${_file} is relative to the binary directory 125 131 SET(_build_unit_file ${CMAKE_BINARY_DIR}/${_file}) 126 132 SET(_get_build_unit_file FALSE) 127 133 SET(_add_to_build_unit TRUE) 128 134 SET(_build_unit_include_string) 135 SET(_build_unit_count "0") 129 136 ELSE() 130 137 # Default, add source file … … 150 157 IF(_file MATCHES "\\.(c|cc|cpp|cxx)$") 151 158 SET(_build_unit_include_string "${_build_unit_include_string}#include \"${_file}\"\n") 159 MATH(EXPR _build_unit_count "1 + ${_build_unit_count}") 152 160 ENDIF() 153 161 # Don't compile these files, even if they are source files … … 169 177 # Remove potential duplicates 170 178 LIST(REMOVE_DUPLICATES _${_target_name}_files) 179 180 # Full build units 181 IF(NOT _arg_ORXONOX_EXTERNAL AND ENABLE_BUILD_UNITS MATCHES "full") 182 GENERATE_BUILD_UNITS(${_target_name} _${_target_name}_files) 183 ENDIF() 171 184 172 185 # TOLUA_FILES -
code/branches/unity_build/src/OrxonoxConfig.cmake
r8569 r8622 44 44 SET(ENABLE_BUILD_UNITS "partial" CACHE STRING "Enables building multiple source files as one.") 45 45 IF(ENABLE_BUILD_UNITS) 46 IF(NOT "${ENABLE_BUILD_UNITS}" STREQUAL "partial") 47 STRING(REGEX REPLACE "^full([1-9][0-9]?)$" "\\1" _nr_of_units "${ENABLE_BUILD_UNITS}") 48 IF("${_nr_of_units}" STREQUAL "${ENABLE_BUILD_UNITS}") # Regex match failed 49 MESSAGE(FATAL_ERROR "Unrecognised option for ENABLE_BUILD_UNITS: ${ENABLE_BUILD_UNITS}") 50 ELSE() 51 SET(NR_OF_BUILD_UNITS ${_nr_of_units}) 52 ENDIF() 53 ENDIF() 46 54 INCLUDE(BuildUnitsConfig.cmake) 47 55 ENDIF()
Note: See TracChangeset
for help on using the changeset viewer.