mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 03:48:14 +00:00
cmake: add -Wl,-rpath,${libdir} to Libs section of pc file for Apple platforms
This commit is contained in:

committed by
Anonymous Maarten

parent
c8372e20d6
commit
e03746b25f
@@ -262,6 +262,12 @@ if(SDL_FRAMEWORK)
|
|||||||
set(SDL_STATIC_AVAILABLE FALSE)
|
set(SDL_STATIC_AVAILABLE FALSE)
|
||||||
endif()
|
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.
|
# Allow some projects to be built conditionally.
|
||||||
set_option(SDL_DISABLE_INSTALL "Disable installation of SDL3" ${SDL3_SUBPROJECT})
|
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)
|
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_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 "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)
|
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})
|
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 "Use X11 video driver" ${UNIX_SYS} "SDL_VIDEO" OFF)
|
||||||
dep_option(SDL_X11_SHARED "Dynamically load X11 support" ON "SDL_X11" 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()
|
else()
|
||||||
set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
|
set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
|
||||||
endif()
|
endif()
|
||||||
|
set(HAVE_RPATH TRUE)
|
||||||
elseif(SOLARIS)
|
elseif(SOLARIS)
|
||||||
set(SDL_RLD_FLAGS "-R\${libdir}")
|
set(SDL_RLD_FLAGS "-R\${libdir}")
|
||||||
endif()
|
|
||||||
set(HAVE_RPATH TRUE)
|
set(HAVE_RPATH TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(QNX)
|
if(QNX)
|
||||||
# QNX's *printf() family generates a SIGSEGV if NULL is passed for a string
|
# QNX's *printf() family generates a SIGSEGV if NULL is passed for a string
|
||||||
@@ -2347,6 +2354,11 @@ elseif(APPLE)
|
|||||||
|
|
||||||
CheckPTHREAD()
|
CheckPTHREAD()
|
||||||
|
|
||||||
|
if(SDL_RPATH AND SDL_SHARED)
|
||||||
|
set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
|
||||||
|
set(HAVE_RPATH TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif(HAIKU)
|
elseif(HAIKU)
|
||||||
if(SDL_AUDIO)
|
if(SDL_AUDIO)
|
||||||
set(SDL_AUDIO_DRIVER_HAIKU 1)
|
set(SDL_AUDIO_DRIVER_HAIKU 1)
|
||||||
|
Reference in New Issue
Block a user