From 580a525b343ec5b3c23a75d5fe57224141bfb802 Mon Sep 17 00:00:00 2001 From: David Zarzycki Date: Tue, 14 Jul 2020 10:47:26 -0400 Subject: [PATCH] [CMake] Simplify dependency generation for tests SWIFT_NATIVE_SWIFT_TOOLS_PATH can be set to a path outside of the build directory and the Xcode approach is simplier anyway. --- test/CMakeLists.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d647ae51cd046..af2301c4ae268 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -114,15 +114,10 @@ function(get_test_dependencies SDK result_var_name) message(FATAL_ERROR "Unknown SDK: ${SDK}") endif() - if(XCODE) - # Xcode's build paths have a configuration variable in them, - # so CMake can't match them at compile time. Just use target names. - list(APPEND deps ${deps_binaries}) - else() - foreach(binary ${deps_binaries}) - list(APPEND deps "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/${binary}${CMAKE_EXECUTABLE_SUFFIX}") - endforeach() - endif() + # Just use target names for dependency generation. This works for both Xcode + # and non-Xcode build systems. In the case of Xcode, its build paths have a + # configuration variable in them, so CMake can't match them at compile time. + list(APPEND deps ${deps_binaries}) set("${result_var_name}" "${deps}" PARENT_SCOPE) endfunction()