|
|
@@ -3133,13 +3133,24 @@ endfunction(cotire_target) |
|
|
|
function (cotire_map_libraries _strategy _mappedLibrariesVar) |
|
|
|
set (_mappedLibraries "") |
|
|
|
foreach (_library ${ARGN}) |
|
|
|
if (_library MATCHES "^\\$<LINK_ONLY:(.+)>$") |
|
|
|
set (_libraryName "${CMAKE_MATCH_1}") |
|
|
|
set (_linkOnly TRUE) |
|
|
|
else() |
|
|
|
set (_libraryName "${_library}") |
|
|
|
set (_linkOnly FALSE) |
|
|
|
endif() |
|
|
|
if ("${_strategy}" MATCHES "COPY_UNITY") |
|
|
|
cotire_is_target_supported(${_library} _isSupported) |
|
|
|
cotire_is_target_supported(${_libraryName} _isSupported) |
|
|
|
if (_isSupported) |
|
|
|
# use target's corresponding unity target, if available |
|
|
|
get_target_property(_libraryUnityTargetName ${_library} COTIRE_UNITY_TARGET_NAME) |
|
|
|
get_target_property(_libraryUnityTargetName ${_libraryName} COTIRE_UNITY_TARGET_NAME) |
|
|
|
if (TARGET "${_libraryUnityTargetName}") |
|
|
|
list (APPEND _mappedLibraries "${_libraryUnityTargetName}") |
|
|
|
if (_linkOnly) |
|
|
|
list (APPEND _mappedLibraries "$<LINK_ONLY:${_libraryUnityTargetName}>") |
|
|
|
else() |
|
|
|
list (APPEND _mappedLibraries "${_libraryUnityTargetName}") |
|
|
|
endif() |
|
|
|
else() |
|
|
|
list (APPEND _mappedLibraries "${_library}") |
|
|
|
endif() |
|
|
|