Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2011, 5:38:43 AM (13 years ago)
Author:
rgrieder
Message:

Added implementation of full build units.
Please refer to r8569 or OrxonoxConfig.cmake for an explanation of the new option.

Location:
code/branches/unity_build/cmake/tools
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/unity_build/cmake/tools/TargetUtilities.cmake

    r8569 r8622  
    6262 #
    6363
     64INCLUDE(BuildUnits)
    6465INCLUDE(CMakeDependentOption)
    6566INCLUDE(CapitaliseName)
     
    120121        ENDIF()
    121122        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}")
    122127      ENDIF()
    123128      SET(_add_to_build_unit FALSE)
    124129    ELSEIF(_get_build_unit_file)
     130      # Note: ${_file} is relative to the binary directory
    125131      SET(_build_unit_file ${CMAKE_BINARY_DIR}/${_file})
    126132      SET(_get_build_unit_file FALSE)
    127133      SET(_add_to_build_unit TRUE)
    128134      SET(_build_unit_include_string)
     135      SET(_build_unit_count "0")
    129136    ELSE()
    130137      # Default, add source file
     
    150157        IF(_file MATCHES "\\.(c|cc|cpp|cxx)$")
    151158          SET(_build_unit_include_string "${_build_unit_include_string}#include \"${_file}\"\n")
     159          MATH(EXPR _build_unit_count "1 + ${_build_unit_count}")
    152160        ENDIF()
    153161        # Don't compile these files, even if they are source files
     
    169177  # Remove potential duplicates
    170178  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()
    171184
    172185  # TOLUA_FILES
Note: See TracChangeset for help on using the changeset viewer.