Codebase list facter / 19797f3
(CFACT-223) Update to Cotire 1.6.9 with import library patch applied. Updating cotire to 1.6.9 with a preemptive patch applied to fix the import library name on Windows. Peter Huene 9 years ago
1 changed file(s) with 143 addition(s) and 67 deletion(s). Raw diff Collapse all Expand all
4343 cmake_policy(POP)
4444 endif()
4545
46 if (NOT CMAKE_VERSION VERSION_LESS "3.1.0")
47 # include TARGET_OBJECTS expressions in a target's SOURCES property
48 cmake_policy(SET CMP0051 NEW)
49 # only interpret if() arguments as variables or keywords when unquoted
50 cmake_policy(SET CMP0054 NEW)
51 endif()
52
4653 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
47 set (COTIRE_CMAKE_MODULE_VERSION "1.6.6")
54 set (COTIRE_CMAKE_MODULE_VERSION "1.6.9")
4855
4956 include(CMakeParseArguments)
5057 include(ProcessorCount)
8491 endif()
8592 endfunction()
8693
94 function (cotire_get_configuration_types _configsVar)
95 set (_configs "")
96 if (CMAKE_CONFIGURATION_TYPES)
97 list (APPEND _configs ${CMAKE_CONFIGURATION_TYPES})
98 endif()
99 if (CMAKE_BUILD_TYPE)
100 list (APPEND _configs "${CMAKE_BUILD_TYPE}")
101 endif()
102 if (_configs)
103 list (REMOVE_DUPLICATES _configs)
104 set (${_configsVar} ${_configs} PARENT_SCOPE)
105 else()
106 set (${_configsVar} "None" PARENT_SCOPE)
107 endif()
108 endfunction()
109
87110 function (cotire_get_source_file_extension _sourceFile _extVar)
88111 # get_filename_component returns extension from first occurrence of . in file name
89112 # this function computes the extension from last occurrence of . in file name
134157 message (STATUS "${_language} ignore extensions: ${_ignoreExtensions}")
135158 message (STATUS "${_language} exclude extensions: ${_excludeExtensions}")
136159 endif()
137 foreach (_sourceFile ${ARGN})
160 if (CMAKE_VERSION VERSION_LESS "3.1.0")
161 set (_allSourceFiles ${ARGN})
162 else()
163 # as of CMake 3.1 target sources may contain generator expressions
164 # since we cannot obtain required property information about source files added
165 # through generator expressions at configure time, we filter them out
166 string (GENEX_STRIP "${ARGN}" _allSourceFiles)
167 endif()
168 foreach (_sourceFile ${_allSourceFiles})
138169 get_source_file_property(_sourceIsHeaderOnly "${_sourceFile}" HEADER_FILE_ONLY)
139170 get_source_file_property(_sourceIsExternal "${_sourceFile}" EXTERNAL_OBJECT)
140171 get_source_file_property(_sourceIsSymbolic "${_sourceFile}" SYMBOLIC)
465496 if (_targetDirs)
466497 list (APPEND _systemIncludeDirs ${_targetDirs})
467498 endif()
468
469499 # interface include directories from linked library targets
470500 cotire_get_target_link_libraries_for_usage_requirements(${_target} _linkLibraries)
471501 foreach (_library ${_linkLibraries})
894924 # English: "Note: including file: C:\directory\file"
895925 # German: "Hinweis: Einlesen der Datei: C:\directory\file"
896926 # We use a very general regular expression, relying on the presence of the : characters
897 if (_line MATCHES ":( +)([^:]+:[^:]+)$")
927 if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
898928 # Visual Studio compiler output
899929 string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
900930 get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
11231153 set(_options "")
11241154 set(_oneValueArgs LANGUAGE)
11251155 set(_multiValueArgs
1126 DEPENDS SOURCES_COMPILE_DEFINITIONS
1156 DEPENDS SOURCE_LOCATIONS SOURCES_COMPILE_DEFINITIONS
11271157 PRE_UNDEFS SOURCES_PRE_UNDEFS POST_UNDEFS SOURCES_POST_UNDEFS PROLOGUE EPILOGUE)
11281158 cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
11291159 if (_option_DEPENDS)
11571187 endif()
11581188 endif()
11591189 set (_compileUndefinitions "")
1190 set (_index 0)
11601191 foreach (_sourceFile ${_sourceFiles})
11611192 cotire_get_source_compile_definitions(
11621193 "${_option_CONFIGURATION}" "${_option_LANGUAGE}" "${_sourceFile}" _compileDefinitions
11881219 list (INSERT _compileUndefinitions 0 "${_definition}")
11891220 endif()
11901221 endforeach()
1191 get_filename_component(_sourceFile "${_sourceFile}" ABSOLUTE)
1222 if (_option_SOURCE_LOCATIONS)
1223 # use explicitly provided source file location
1224 list (GET _option_SOURCE_LOCATIONS ${_index} _sourceFileLocation)
1225 else()
1226 # use absolute path as source file location
1227 get_filename_component(_sourceFileLocation "${_sourceFile}" ABSOLUTE)
1228 endif()
11921229 if (WIN32)
1193 file (TO_NATIVE_PATH "${_sourceFile}" _sourceFile)
1194 endif()
1195 list (APPEND _contents "#include \"${_sourceFile}\"")
1230 file (TO_NATIVE_PATH "${_sourceFileLocation}" _sourceFileLocation)
1231 endif()
1232 list (APPEND _contents "#include \"${_sourceFileLocation}\"")
1233 math (EXPR _index "${_index} + 1")
11961234 endforeach()
11971235 if (_compileUndefinitions)
11981236 cotire_append_undefs(_contents ${_compileUndefinitions})
16541692 set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
16551693 endif()
16561694 if (CMAKE_${_language}_COMPILER MATCHES "ccache")
1657 if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
1695 if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros|pch_defines")
16581696 set (${_msgVar}
1659 "ccache requires the environment variable CCACHE_SLOPPINESS to be set to time_macros."
1697 "ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
16601698 PARENT_SCOPE)
16611699 endif()
16621700 endif()
16631701 if (APPLE)
16641702 # PCH compilation not supported by GCC / Clang for multi-architecture builds (e.g., i386, x86_64)
1665 if (CMAKE_CONFIGURATION_TYPES)
1666 set (_configs ${CMAKE_CONFIGURATION_TYPES})
1667 elseif (CMAKE_BUILD_TYPE)
1668 set (_configs ${CMAKE_BUILD_TYPE})
1669 else()
1670 set (_configs "None")
1671 endif()
1703 cotire_get_configuration_types(_configs)
16721704 foreach (_config ${_configs})
16731705 set (_targetFlags "")
16741706 cotire_get_target_compile_flags("${_config}" "${_language}" "${_targetSourceDir}" "${_target}" _targetFlags)
19051937
19061938 function (cotire_generate_target_script _language _configurations _targetSourceDir _targetBinaryDir _target _targetScriptVar _targetConfigScriptVar)
19071939 set (COTIRE_TARGET_SOURCES ${ARGN})
1940 cotire_get_source_file_property_values(COTIRE_TARGET_SOURCE_LOCATIONS LOCATION ${COTIRE_TARGET_SOURCES})
19081941 cotire_get_prefix_header_dependencies(${_language} ${_target} COTIRE_TARGET_PREFIX_DEPENDS ${COTIRE_TARGET_SOURCES})
19091942 cotire_get_unity_source_dependencies(${_language} ${_target} COTIRE_TARGET_UNITY_DEPENDS ${COTIRE_TARGET_SOURCES})
19101943 # set up variables to be configured
19391972 set (_contents "")
19401973 set (_contentsHasGeneratorExpressions FALSE)
19411974 foreach (_var IN LISTS _matchVars ITEMS
1942 MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
1975 XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
19431976 CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
19441977 CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
19451978 if (DEFINED ${_var})
21682201 # see cotire_setup_pch_file_inclusion
21692202 if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
21702203 get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
2171 get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
2172 set (_flags "")
2173 cotire_determine_compiler_version("${_language}" COTIRE_${_language}_COMPILER)
2174 cotire_add_prefix_pch_inclusion_flags(
2175 "${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${COTIRE_${_language}_COMPILER_VERSION}"
2176 "${_prefixFile}" "${_pchFile}" _flags)
2177 set_property(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
2204 if (_prefixFile)
2205 set (_flags "")
2206 cotire_determine_compiler_version("${_language}" COTIRE_${_language}_COMPILER)
2207 get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
2208 cotire_add_prefix_pch_inclusion_flags(
2209 "${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${COTIRE_${_language}_COMPILER_VERSION}"
2210 "${_prefixFile}" "${_pchFile}" _flags)
2211 set_property(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
2212 endif()
21782213 endif()
21792214 endif()
21802215 endif()
21862221 foreach (_unityFile ${_unityFiles})
21872222 file (RELATIVE_PATH _unityFileRelPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
21882223 set_property (SOURCE "${_unityFile}" PROPERTY GENERATED TRUE)
2189 # set up compiled unity source dependencies
2224 # set up compiled unity source dependencies via OBJECT_DEPENDS
21902225 # this ensures that missing source files are generated before the unity file is compiled
21912226 if (COTIRE_DEBUG AND _dependencySources)
21922227 message (STATUS "${_unityFile} OBJECT_DEPENDS ${_dependencySources}")
21932228 endif()
21942229 if (_dependencySources)
2195 set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_dependencySources})
2230 # the OBJECT_DEPENDS property requires a list of full paths
2231 set (_objectDependsPaths "")
2232 foreach (_sourceFile ${_dependencySources})
2233 get_source_file_property(_sourceLocation "${_sourceFile}" LOCATION)
2234 list (APPEND _objectDependsPaths "${_sourceLocation}")
2235 endforeach()
2236 set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
21962237 endif()
21972238 if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
21982239 # unity file compilation results in potentially huge object file, thus use /bigobj by default unter MSVC and Windows Intel
22002241 endif()
22012242 cotire_set_cmd_to_prologue(_unityCmd)
22022243 list (APPEND _unityCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "unity" "${_targetConfigScript}" "${_unityFile}")
2244 if (CMAKE_VERSION VERSION_LESS "3.1.0")
2245 set (_unityCmdDepends "${_targetScript}")
2246 else()
2247 # CMake 3.1.0 supports generator expressions in arguments to DEPENDS
2248 set (_unityCmdDepends "${_targetConfigScript}")
2249 endif()
22032250 if (COTIRE_DEBUG)
2204 message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_targetScript}")
2251 message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_unityCmdDepends}")
22052252 endif()
22062253 add_custom_command(
22072254 OUTPUT "${_unityFile}"
22082255 COMMAND ${_unityCmd}
2209 DEPENDS "${_targetScript}"
2256 DEPENDS ${_unityCmdDepends}
22102257 COMMENT "Generating ${_language} unity source ${_unityFileRelPath}"
22112258 WORKING_DIRECTORY "${_targetSourceDir}" VERBATIM)
22122259 list (APPEND ${_cmdsVar} COMMAND ${_unityCmd})
23822429 set (${_targetMsgVar} "${_targetMsg}" PARENT_SCOPE)
23832430 endfunction()
23842431
2385 function (cotire_choose_target_languages _targetSourceDir _target _targetLanguagesVar)
2432 function (cotire_choose_target_languages _targetSourceDir _target _targetLanguagesVar _wholeTargetVar)
23862433 set (_languages ${ARGN})
23872434 set (_allSourceFiles "")
23882435 set (_allExcludedSourceFiles "")
23892436 set (_allCotiredSourceFiles "")
23902437 set (_targetLanguages "")
2438 set (_pchEligibleTargetLanguages "")
23912439 get_target_property(_targetType ${_target} TYPE)
23922440 get_target_property(_targetSourceFiles ${_target} SOURCES)
23932441 get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
24172465 if (_sourceFiles)
24182466 list (APPEND _allSourceFiles ${_sourceFiles})
24192467 endif()
2468 list (LENGTH _sourceFiles _numberOfSources)
2469 if (NOT _numberOfSources LESS ${COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES})
2470 list (APPEND _pchEligibleTargetLanguages ${_language})
2471 endif()
24202472 if (_excludedSources)
24212473 list (APPEND _allExcludedSourceFiles ${_excludedSources})
24222474 endif()
24322484 set (_targetAddSCU FALSE)
24332485 endif()
24342486 if (_targetUsePCH)
2435 list (LENGTH _allSourceFiles _numberOfSources)
2436 if (_numberOfSources LESS ${COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES})
2437 set (_disableMsg "Too few applicable sources.")
2438 set (_targetUsePCH FALSE)
2439 elseif (_allCotiredSourceFiles)
2487 if (_allCotiredSourceFiles)
24402488 cotire_get_source_file_property_values(_cotireTargets COTIRE_TARGET ${_allCotiredSourceFiles})
24412489 list (REMOVE_DUPLICATES _cotireTargets)
24422490 string (REPLACE ";" ", " _cotireTargetsStr "${_cotireTargets}")
24442492 set (_disableMsg "${_disableMsg} Set target property COTIRE_ENABLE_PRECOMPILED_HEADER to FALSE for targets ${_target},")
24452493 set (_disableMsg "${_disableMsg} ${_cotireTargetsStr} to get a workable build system.")
24462494 set (_targetMsgLevel SEND_ERROR)
2495 set (_targetUsePCH FALSE)
2496 elseif (NOT _pchEligibleTargetLanguages)
2497 set (_disableMsg "Too few applicable sources.")
24472498 set (_targetUsePCH FALSE)
24482499 elseif (XCODE AND _allExcludedSourceFiles)
24492500 # for Xcode, we cannot apply the precompiled header to individual sources, only to the whole target
24692520 message (${_targetMsgLevel} "${_targetMsg}")
24702521 endif()
24712522 endif()
2523 list (LENGTH _targetLanguages _numberOfLanguages)
2524 if (_numberOfLanguages GREATER 1 OR _allExcludedSourceFiles)
2525 set (${_wholeTargetVar} FALSE PARENT_SCOPE)
2526 else()
2527 set (${_wholeTargetVar} TRUE PARENT_SCOPE)
2528 endif()
24722529 set (${_targetLanguagesVar} ${_targetLanguages} PARENT_SCOPE)
24732530 endfunction()
24742531
24962553 set (${_maxIncludesVar} ${_maxIncludes} PARENT_SCOPE)
24972554 endfunction()
24982555
2499 function (cotire_process_target_language _language _configurations _targetSourceDir _targetBinaryDir _target _wholeTargetVar _cmdsVar)
2556 function (cotire_process_target_language _language _configurations _targetSourceDir _targetBinaryDir _target _wholeTarget _cmdsVar)
25002557 set (${_cmdsVar} "" PARENT_SCOPE)
25012558 get_target_property(_targetSourceFiles ${_target} SOURCES)
25022559 set (_sourceFiles "")
25062563 if (NOT _sourceFiles AND NOT _cotiredSources)
25072564 return()
25082565 endif()
2509 set (_wholeTarget ${${_wholeTargetVar}})
25102566 set (_cmds "")
25112567 # check for user provided unity source file list
25122568 get_property(_unitySourceFiles TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE_INIT)
25332589 cotire_setup_prefix_generation_from_unity_command(
25342590 ${_language} ${_target} "${_targetSourceDir}" "${_targetConfigScript}" "${_prefixFile}" "${_unityFiles}" _cmds ${_unitySourceFiles})
25352591 endif()
2536 get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
2592 # check if selected language has enough sources at all
2593 list (LENGTH _sourceFiles _numberOfSources)
2594 if (_numberOfSources LESS ${COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES})
2595 set (_targetUsePCH FALSE)
2596 else()
2597 get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
2598 endif()
25372599 if (_targetUsePCH)
25382600 cotire_make_pch_file_path(${_language} "${_targetSourceDir}" ${_target} _pchFile)
25392601 if (_pchFile)
25402602 cotire_setup_pch_file_compilation(
25412603 ${_language} ${_target} "${_targetSourceDir}" "${_targetConfigScript}" "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
2542 if (_excludedSources)
2543 set (_wholeTarget FALSE)
2544 endif()
25452604 cotire_setup_pch_file_inclusion(
25462605 ${_language} ${_target} ${_wholeTarget} "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
25472606 endif()
25482607 elseif (_prefixHeaderFiles)
2549 # user provided prefix header must be included
2550 cotire_setup_prefix_file_inclusion(
2551 ${_language} ${_target} "${_prefixFile}" ${_sourceFiles})
2608 # user provided prefix header must be included unconditionally
2609 cotire_setup_prefix_file_inclusion(${_language} ${_target} "${_prefixFile}" ${_sourceFiles})
25522610 endif()
25532611 endif()
25542612 # mark target as cotired for language
25592617 set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER "${_pchFile}")
25602618 endif()
25612619 endif()
2562 set (${_wholeTargetVar} ${_wholeTarget} PARENT_SCOPE)
25632620 set (${_cmdsVar} ${_cmds} PARENT_SCOPE)
25642621 endfunction()
25652622
26992756 LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
27002757 OUTPUT_NAME OUTPUT_NAME_<CONFIG>
27012758 RUNTIME_OUTPUT_NAME RUNTIME_OUTPUT_NAME_<CONFIG>
2702 PREFIX <CONFIG>_POSTFIX SUFFIX)
2759 PREFIX <CONFIG>_POSTFIX SUFFIX
2760 IMPORT_PREFIX IMPORT_SUFFIX)
27032761 # copy compile stuff
27042762 cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
27052763 COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
27762834 get_property (_option_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
27772835 endif()
27782836 if (NOT _option_CONFIGURATIONS)
2779 if (CMAKE_CONFIGURATION_TYPES)
2780 set (_option_CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
2781 elseif (CMAKE_BUILD_TYPE)
2782 set (_option_CONFIGURATIONS "${CMAKE_BUILD_TYPE}")
2783 else()
2784 set (_option_CONFIGURATIONS "None")
2785 endif()
2837 cotire_get_configuration_types(_option_CONFIGURATIONS)
27862838 endif()
27872839 # trivial checks
27882840 get_target_property(_imported ${_target} IMPORTED)
28152867 endif()
28162868 endif()
28172869 # choose languages that apply to the target
2818 cotire_choose_target_languages("${_option_SOURCE_DIR}" "${_target}" _targetLanguages ${_option_LANGUAGES})
2870 cotire_choose_target_languages("${_option_SOURCE_DIR}" "${_target}" _targetLanguages _wholeTarget ${_option_LANGUAGES})
28192871 if (NOT _targetLanguages)
28202872 return()
2821 endif()
2822 list (LENGTH _targetLanguages _numberOfLanguages)
2823 if (_numberOfLanguages GREATER 1)
2824 set (_wholeTarget FALSE)
2825 else()
2826 set (_wholeTarget TRUE)
28272873 endif()
28282874 set (_cmds "")
28292875 foreach (_language ${_targetLanguages})
28302876 cotire_process_target_language("${_language}" "${_option_CONFIGURATIONS}"
2831 "${_option_SOURCE_DIR}" "${_option_BINARY_DIR}" ${_target} _wholeTarget _cmd)
2877 "${_option_SOURCE_DIR}" "${_option_BINARY_DIR}" ${_target} ${_wholeTarget} _cmd)
28322878 if (_cmd)
28332879 list (APPEND _cmds ${_cmd})
28342880 endif()
28522898 set (_mappedLibraries "")
28532899 foreach (_library ${ARGN})
28542900 if (TARGET "${_library}" AND "${_strategy}" MATCHES "COPY_UNITY")
2901 # use target's corresponding unity target, if available
28552902 get_target_property(_libraryUnityTargetName ${_library} COTIRE_UNITY_TARGET_NAME)
28562903 if (TARGET "${_libraryUnityTargetName}")
28572904 list (APPEND _mappedLibraries "${_libraryUnityTargetName}")
28772924 if (CMAKE_VERSION VERSION_LESS "2.8.11")
28782925 message (WARNING "cotire: unity target link strategy ${_linkLibrariesStrategy} requires CMake 2.8.11 or later. Defaulting to NONE for ${_target}.")
28792926 else()
2927 set (_unityLinkLibraries "")
28802928 get_target_property(_linkLibraries ${_target} LINK_LIBRARIES)
2929 if (_linkLibraries)
2930 list (APPEND _unityLinkLibraries ${_linkLibraries})
2931 endif()
28812932 get_target_property(_interfaceLinkLibraries ${_target} INTERFACE_LINK_LIBRARIES)
2882 cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkLibraries ${_linkLibraries} ${_interfaceLinkLibraries})
2933 if (_interfaceLinkLibraries)
2934 list (APPEND _unityLinkLibraries ${_interfaceLinkLibraries})
2935 endif()
2936 cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkLibraries ${_unityLinkLibraries})
28832937 if (COTIRE_DEBUG)
28842938 message (STATUS "unity target ${_unityTargetName} libraries: ${_unityLinkLibraries}")
28852939 endif()
30253079 list (FIND COTIRE_TARGET_CONFIGURATION_TYPES "${COTIRE_BUILD_TYPE}" _index)
30263080 if (_index GREATER -1)
30273081 set (_sources ${COTIRE_TARGET_SOURCES})
3082 set (_sourceLocations ${COTIRE_TARGET_SOURCE_LOCATIONS})
30283083 set (_sourcesDefinitions ${COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig}})
30293084 else()
30303085 if (COTIRE_DEBUG)
30313086 message (STATUS "COTIRE_BUILD_TYPE=${COTIRE_BUILD_TYPE} not cotired (${COTIRE_TARGET_CONFIGURATION_TYPES})")
30323087 endif()
30333088 set (_sources "")
3089 set (_sourceLocations "")
30343090 set (_sourcesDefinitions "")
30353091 endif()
30363092 set (_targetPreUndefs ${COTIRE_TARGET_PRE_UNDEFS})
30403096
30413097 if ("${COTIRE_ARGV1}" STREQUAL "unity")
30423098
3099 if (XCODE)
3100 # executing pre-build action under Xcode, check dependency on target script
3101 set (_dependsOption DEPENDS "${COTIRE_ARGV2}")
3102 else()
3103 # executing custom command, no need to re-check for dependencies
3104 set (_dependsOption "")
3105 endif()
3106
30433107 cotire_select_unity_source_files("${COTIRE_ARGV3}" _sources ${_sources})
3108 cotire_select_unity_source_files("${COTIRE_ARGV3}" _sourceLocations ${_sourceLocations})
3109
30443110 cotire_generate_unity_source(
30453111 "${COTIRE_ARGV3}" ${_sources}
30463112 LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
3047 DEPENDS "${COTIRE_ARGV0}" "${COTIRE_ARGV2}"
3113 SOURCE_LOCATIONS ${_sourceLocations}
30483114 SOURCES_COMPILE_DEFINITIONS ${_sourcesDefinitions}
30493115 PRE_UNDEFS ${_targetPreUndefs}
30503116 POST_UNDEFS ${_targetPostUndefs}
30513117 SOURCES_PRE_UNDEFS ${_sourcesPreUndefs}
3052 SOURCES_POST_UNDEFS ${_sourcesPostUndefs})
3118 SOURCES_POST_UNDEFS ${_sourcesPostUndefs}
3119 ${_dependsOption})
30533120
30543121 elseif ("${COTIRE_ARGV1}" STREQUAL "prefix")
3122
3123 if (XCODE)
3124 # executing pre-build action under Xcode, check dependency on unity file and prefix dependencies
3125 set (_dependsOption DEPENDS "${COTIRE_ARGV4}" ${COTIRE_TARGET_PREFIX_DEPENDS})
3126 else()
3127 # executing custom command, no need to re-check for dependencies
3128 set (_dependsOption "")
3129 endif()
30553130
30563131 set (_files "")
30573132 foreach (_index RANGE 4 ${COTIRE_ARGC})
30673142 COMPILER_ID "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ID}"
30683143 COMPILER_VERSION "${COTIRE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}"
30693144 LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
3070 DEPENDS "${COTIRE_ARGV0}" "${COTIRE_ARGV4}" ${COTIRE_TARGET_PREFIX_DEPENDS}
30713145 IGNORE_PATH "${COTIRE_TARGET_IGNORE_PATH};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH}"
30723146 INCLUDE_PATH ${COTIRE_TARGET_INCLUDE_PATH}
30733147 IGNORE_EXTENSIONS "${CMAKE_${COTIRE_TARGET_LANGUAGE}_SOURCE_FILE_EXTENSIONS};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS}"
30753149 INCLUDE_DIRECTORIES ${_includeDirs}
30763150 SYSTEM_INCLUDE_DIRECTORIES ${_systemIncludeDirs}
30773151 COMPILE_DEFINITIONS ${_compileDefinitions}
3078 COMPILE_FLAGS ${_compileFlags})
3152 COMPILE_FLAGS ${_compileFlags}
3153 ${_dependsOption})
30793154
30803155 elseif ("${COTIRE_ARGV1}" STREQUAL "precompile")
30813156
31123187 list (APPEND _files "${COTIRE_ARGV${_index}}")
31133188 endif()
31143189 endforeach()
3190
31153191 if (COTIRE_TARGET_LANGUAGE)
31163192 cotire_generate_unity_source(${_files} LANGUAGE "${COTIRE_TARGET_LANGUAGE}")
31173193 else()