Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(macos): add RPATH configuration for macOS builds #502

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ option(ENABLE_UTILS "Build util programs" OFF)
option(ENABLE_EXAMPLES "Build example programs" OFF)
option(ENABLE_MULTITHREADING "Enable multithreading support" OFF)

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_INSTALL_RPATH "${INSTALL_LIB_DIR}")
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
endif()

if(ENABLE_TESTS)
set(ENABLE_UTILS ON CACHE BOOL "Building utils required by tests" FORCE)
endif()
Expand Down
8 changes: 8 additions & 0 deletions utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ endif()
foreach(TARGET ${UTILITIES})
add_executable(${TARGET} ${TARGET}.c)
target_link_libraries(${TARGET} nfs nfs_mount)

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set_target_properties(${TARGET} PROPERTIES
INSTALL_RPATH "${INSTALL_LIB_DIR}"
BUILD_RPATH "${INSTALL_LIB_DIR}"
)
endif()

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}
DESTINATION ${INSTALL_BIN_DIR})
endforeach()
Loading