Skip to content

Commit

Permalink
Fix working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jun 18, 2024
1 parent 4404578 commit d3eb947
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/FindOpenMPMacOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ function(patch_openmp_path_macos target target_default_output_name)
# Override the absolute path to OpenMP with a relative one using @rpath.
#
# This also ensures that if a libomp.dylib has already been loaded, it'll just use that.
if(KEEP_BUILD_ARTIFACTS_IN_BINARY_DIR)
set(__LIB_DIR ${xgboost_BINARY_DIR}/lib)
else()
set(__LIB_DIR ${xgboost_SOURCE_DIR}/lib)
endif()
add_custom_command(
TARGET ${target}
POST_BUILD
Expand All @@ -90,7 +95,7 @@ function(patch_openmp_path_macos target target_default_output_name)
${__OpenMP_LIBRARY_LOCATION}
"@rpath/${__OpenMP_LIBRARY_NAME}"
"${__LIBXGBOOST_FILENAME_${target}}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
WORKING_DIRECTORY ${__LIB_DIR}
COMMENT
"${__LIBXGBOOST_FILENAME_${target}}: "
"Replacing hard-coded OpenMP install_name with '@rpath/${__OpenMP_LIBRARY_NAME}'..."
Expand Down

0 comments on commit d3eb947

Please sign in to comment.