From a8b50baf873f75c4c363a7cfd8b66898b94c4dcc Mon Sep 17 00:00:00 2001 From: Sascha Kratky Date: Sun, 18 Mar 2018 10:20:46 +0100 Subject: [PATCH] fix handing of MANUALLY_ADDED_DEPENDENCIES --- CMake/cotire.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMake/cotire.cmake b/CMake/cotire.cmake index 42d14e6..850aa85 100644 --- a/CMake/cotire.cmake +++ b/CMake/cotire.cmake @@ -3121,6 +3121,7 @@ function (cotire_collect_unity_target_sources _target _languages _unityTargetSou list (APPEND _unityTargetSources ${_unityFiles}) endif() endforeach() + # handle object libraries which are part of the target's sources get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT) if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$") cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles}) @@ -3469,7 +3470,9 @@ function (cotire_target_link_libraries _target) get_target_property(_manualDependencies ${_target} MANUALLY_ADDED_DEPENDENCIES) if (_manualDependencies) cotire_map_libraries("${_linkLibrariesStrategy}" _unityManualDependencies ${_manualDependencies}) - add_dependencies("${_unityTargetName}" _unityManualDependencies) + if (_unityManualDependencies) + add_dependencies("${_unityTargetName}" ${_unityManualDependencies}) + endif() endif() endif() endif()