Skip to content

Commit

Permalink
Try using fancy environment modification features.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Mar 4, 2024
1 parent 37efaa0 commit 0ff827e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmake/modules/FindSwiftXCTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ function(add_swift_xctest test_target testee)
# If the executable target depends on DLLs their directories need to be injected into the PATH
# or they won't be found and the target will fail to run, so invoke it through cmake. Because
COMMAND
${CMAKE_COMMAND} -E env
"PATH=$<JOIN:$<TARGET_RUNTIME_DLL_DIRS:GenerateXCTestMain>;$ENV{PATH},;>"
${CMAKE_COMMAND} -E env --modify
"$<LIST:TRANSFORM,$<TARGET_RUNTIME_DLL_DIRS>,PREPEND,PATH=>"
--
$<TARGET_FILE:GenerateXCTestMain> -o ${test_main} ${sources}
DEPENDS ${sources} GenerateXCTestMain
Expand All @@ -150,7 +150,7 @@ function(add_swift_xctest test_target testee)
# (and interpreted by CMake). [It] is then used to populate CTestTestfile.cmake, which is later
# read by CTest to setup your test environment.”
set_tests_properties(${test_target}
PROPERTIES ENVIRONMENT "PATH=$<JOIN:$<TARGET_RUNTIME_DLL_DIRS:${test_target}>;${path},\\;>")
PROPERTIES ENVIRONMENT_MODIFICATION "$<LIST:TRANSFORM,$<TARGET_RUNTIME_DLL_DIRS>,PREPEND,PATH=>")

endif()

Expand Down

0 comments on commit 0ff827e

Please sign in to comment.