Skip to content

Commit

Permalink
Properly handle prepending user-specified paths to DYLD_FRAMEWORK_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Aug 13, 2024
1 parent 1538be6 commit a579b5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extras/CatchAddTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ function(catch_discover_tests_impl)
endif()

if(APPLE AND dl_framework_paths)
cmake_path(CONVERT "${dl_framework_paths}" TO_NATIVE_PATH_LIST paths)
cmake_path(CONVERT "$ENV{DYLD_FRAMEWORK_PATH}" TO_NATIVE_PATH_LIST env_dl_framework_paths)
list(PREPEND env_dl_framework_paths "${dl_framework_paths}")
cmake_path(CONVERT "${env_dl_framework_paths}" TO_NATIVE_PATH_LIST paths)
set(ENV{DYLD_FRAMEWORK_PATH} "${paths}")
endif()

Expand Down Expand Up @@ -133,7 +135,7 @@ function(catch_discover_tests_impl)
if(APPLE AND dl_framework_paths)
foreach(path ${dl_framework_paths})
cmake_path(NATIVE_PATH path native_path)
list(APPEND environment_modifications "DYLD_FRAMEWORK_PATH=path_list_prepend:${native_path}")
list(PREPEND environment_modifications "DYLD_FRAMEWORK_PATH=path_list_prepend:${native_path}")
endforeach()
endif()

Expand Down

0 comments on commit a579b5f

Please sign in to comment.