More rpath fixes -- this time for macOS.

This commit is contained in:
casey langen 2021-12-28 13:36:07 -08:00
parent 18960811cc
commit 6572465e1c
6 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,7 @@
0.96.10
* fixed race condition in WasapiOut that caused the app to crash.
* fixed `-rpath` for macOS build.
0.96.9

View File

@ -111,8 +111,18 @@ message(STATUS "[build] link libraries are: ${musikcube_LINK_LIBS}")
# ensure the binaries can find libmusikcore.so, which lives in the
# same directory.
if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
# in Linux/BSD distributions we can specify the magic "$ORIGIN" value for
# the rpath for the dymamic linker to search the executable's directory
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
else()
# from what i can tell, the macos dynamic linker does not support relative
# rpath values, so the aboslute path to libmusikcube.dylib needs to be baked
# in using these special flags. additionally, the rpath value specified here
# is not applied to the binaries until the user runs `make install`.
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/share/musikcube/")
endif()
if (EXISTS "/etc/arch-release" OR EXISTS "/etc/manjaro-release" OR NO_NCURSESW)

View File

@ -9,6 +9,4 @@ endif()
add_executable(core_c_demo ${CORE_C_DEMO_SRCS})
set_target_properties(core_c_demo PROPERTIES LINK_FLAGS "-Wl,-rpath,$ORIGIN")
target_link_libraries(core_c_demo ${musikcube_LINK_LIBS} musikcore)

View File

@ -39,7 +39,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 96
#define VERSION_PATCH 10
#define VERSION_COMMIT_HASH "#4bb9bbad"
#define VERSION_COMMIT_HASH "#18960811"
#define VERSION "0.96.10"
namespace musik {

View File

@ -79,8 +79,6 @@ configure_file("musikcube.in" "musikcube" @ONLY)
add_executable(musikcube ${CUBE_SRCS})
add_definitions(-DNCURSES_WIDECHAR)
set_target_properties(musikcube PROPERTIES LINK_FLAGS "-Wl,-rpath,$ORIGIN")
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
if (${LINK_STATICALLY} MATCHES "true")
find_library(

View File

@ -12,8 +12,6 @@ endif()
configure_file("musikcubed.in" "musikcubed" @ONLY)
add_executable(musikcubed ${DAEMON_SRCS})
set_target_properties(musikcubed PROPERTIES LINK_FLAGS "-Wl,-rpath,$ORIGIN")
if (${LINK_STATICALLY} MATCHES "true")
find_library(EVLIB NAMES libev.a ev)
target_link_libraries(musikcubed ${musikcube_LINK_LIBS} ${EVLIB} musikcore)