|
|
@@ -2884,6 +2884,16 @@ function (cotire_setup_pch_target _languages _configurations _target) |
|
|
|
endif() |
|
|
|
endfunction() |
|
|
|
|
|
|
|
function (cotire_filter_object_libraries _target _objectLibrariesVar) |
|
|
|
set (_objectLibraries "") |
|
|
|
foreach (_source ${ARGN}) |
|
|
|
if (_source MATCHES "^\\$<TARGET_OBJECTS:.+>$") |
|
|
|
list (APPEND _objectLibraries "${_source}") |
|
|
|
endif() |
|
|
|
endforeach() |
|
|
|
set (${_objectLibrariesVar} ${_objectLibraries} PARENT_SCOPE) |
|
|
|
endfunction() |
|
|
|
|
|
|
|
function (cotire_collect_unity_target_sources _target _languages _unityTargetSourcesVar) |
|
|
|
get_target_property(_targetSourceFiles ${_target} SOURCES) |
|
|
|
set (_unityTargetSources ${_targetSourceFiles}) |
|
|
@@ -2902,6 +2912,15 @@ function (cotire_collect_unity_target_sources _target _languages _unityTargetSou |
|
|
|
list (APPEND _unityTargetSources ${_unityFiles}) |
|
|
|
endif() |
|
|
|
endforeach() |
|
|
|
get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT) |
|
|
|
if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$") |
|
|
|
cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles}) |
|
|
|
if (_objectLibraries) |
|
|
|
cotire_map_libraries("${_linkLibrariesStrategy}" _unityObjectLibraries ${_objectLibraries}) |
|
|
|
list (REMOVE_ITEM _unityTargetSources ${_objectLibraries}) |
|
|
|
list (APPEND _unityTargetSources ${_unityObjectLibraries}) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
set (${_unityTargetSourcesVar} ${_unityTargetSources} PARENT_SCOPE) |
|
|
|
endfunction() |
|
|
|
|
|
|
@@ -3178,9 +3197,15 @@ function (cotire_map_libraries _strategy _mappedLibrariesVar) |
|
|
|
if (_library MATCHES "^\\$<LINK_ONLY:(.+)>$") |
|
|
|
set (_libraryName "${CMAKE_MATCH_1}") |
|
|
|
set (_linkOnly TRUE) |
|
|
|
set (_objectLibrary FALSE) |
|
|
|
elseif (_library MATCHES "^\\$<TARGET_OBJECTS:(.+)>$") |
|
|
|
set (_libraryName "${CMAKE_MATCH_1}") |
|
|
|
set (_linkOnly FALSE) |
|
|
|
set (_objectLibrary TRUE) |
|
|
|
else() |
|
|
|
set (_libraryName "${_library}") |
|
|
|
set (_linkOnly FALSE) |
|
|
|
set (_objectLibrary FALSE) |
|
|
|
endif() |
|
|
|
if ("${_strategy}" MATCHES "COPY_UNITY") |
|
|
|
cotire_is_target_supported(${_libraryName} _isSupported) |
|
|
@@ -3190,6 +3215,8 @@ function (cotire_map_libraries _strategy _mappedLibrariesVar) |
|
|
|
if (TARGET "${_libraryUnityTargetName}") |
|
|
|
if (_linkOnly) |
|
|
|
list (APPEND _mappedLibraries "$<LINK_ONLY:${_libraryUnityTargetName}>") |
|
|
|
elseif (_objectLibrary) |
|
|
|
list (APPEND _mappedLibraries "$<TARGET_OBJECTS:${_libraryUnityTargetName}>") |
|
|
|
else() |
|
|
|
list (APPEND _mappedLibraries "${_libraryUnityTargetName}") |
|
|
|
endif() |
|
|
|