Skip to content

Commit

Permalink
fix: RPATH in macOS, who use @loader_path instead of $ORIGIN (#26)
Browse files Browse the repository at this point in the history
All UNIX like OS use $ORIGIN except f**king macOS, who use @loader_path.

Ref: https://lekensteyn.nl/rpath.html
  • Loading branch information
CoelacanthusHex authored Dec 20, 2023
1 parent 09bbc3e commit 29dc4ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
option(LINUX_MINGW32 "Build for windows on Linux" OFF)

if(APPLE)
set(RPATH_BINARY_PATH "@loader_path")
else()
set(RPATH_BINARY_PATH "$ORIGIN")
endif()

include_directories(.)
aux_source_directory(. DIR_LPAC_SRCS)
aux_source_directory(applet DIR_LPAC_SRCS)
Expand All @@ -9,7 +15,7 @@ aux_source_directory(applet/profile DIR_LPAC_SRCS)
add_executable(lpac ${DIR_LPAC_SRCS})
set_target_properties(lpac PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/output"
BUILD_RPATH "$ORIGIN"
BUILD_RPATH "${RPATH_BINARY_PATH}"
)
target_link_libraries(lpac euicc)

Expand Down

0 comments on commit 29dc4ba

Please sign in to comment.