cmake: add -Wl,-rpath,${libdir} to Libs section of pc file for Apple platforms

main
Anonymous Maarten 2024-02-25 16:33:46 +01:00 committed by Anonymous Maarten
parent c8372e20d6
commit e03746b25f
1 changed files with 14 additions and 2 deletions

View File

@ -262,6 +262,12 @@ if(SDL_FRAMEWORK)
set(SDL_STATIC_AVAILABLE FALSE)
endif()
if(UNIX AND NOT ANDROID AND NOT RISCOS AND NOT SDL_FRAMEWORK)
set(SDL_RPATH_DEFAULT ON)
else()
set(SDL_RPATH_DEFAULT OFF)
endif()
# Allow some projects to be built conditionally.
set_option(SDL_DISABLE_INSTALL "Disable installation of SDL3" ${SDL3_SUBPROJECT})
cmake_dependent_option(SDL_DISABLE_INSTALL_CPACK "Create binary SDL3 archive using CPack" ${SDL3_SUBPROJECT} "NOT SDL_DISABLE_INSTALL" ON)
@ -312,7 +318,7 @@ dep_option(SDL_PULSEAUDIO "Use PulseAudio" ${UNIX_SYS} "SDL_AUDIO" OFF)
dep_option(SDL_PULSEAUDIO_SHARED "Dynamically load PulseAudio support" ON "SDL_PULSEAUDIO" OFF)
dep_option(SDL_SNDIO "Support the sndio audio API" ${UNIX_SYS} "SDL_AUDIO" OFF)
dep_option(SDL_SNDIO_SHARED "Dynamically load the sndio audio API" ON "SDL_SNDIO" OFF)
set_option(SDL_RPATH "Use an rpath when linking SDL" ${UNIX_SYS})
set_option(SDL_RPATH "Use an rpath when linking SDL" ${SDL_RPATH_DEFAULT})
set_option(SDL_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" ${SDL_CLOCK_GETTIME_DEFAULT})
dep_option(SDL_X11 "Use X11 video driver" ${UNIX_SYS} "SDL_VIDEO" OFF)
dep_option(SDL_X11_SHARED "Dynamically load X11 support" ON "SDL_X11" OFF)
@ -1763,11 +1769,12 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
else()
set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
endif()
set(HAVE_RPATH TRUE)
elseif(SOLARIS)
set(SDL_RLD_FLAGS "-R\${libdir}")
endif()
set(HAVE_RPATH TRUE)
endif()
endif()
if(QNX)
# QNX's *printf() family generates a SIGSEGV if NULL is passed for a string
@ -2347,6 +2354,11 @@ elseif(APPLE)
CheckPTHREAD()
if(SDL_RPATH AND SDL_SHARED)
set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
set(HAVE_RPATH TRUE)
endif()
elseif(HAIKU)
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_HAIKU 1)