cmake: add SDL_ prefix to EXTRA_LIBS/EXTRA_LDFLAGS
parent
bffbfa572c
commit
77025417dd
117
CMakeLists.txt
117
CMakeLists.txt
|
@ -11,16 +11,16 @@ else()
|
|||
set(SDL3_SUBPROJECT ON)
|
||||
endif()
|
||||
|
||||
set(EXTRA_LIBS)
|
||||
set(EXTRA_LDFLAGS)
|
||||
set(SDL_EXTRA_LIBS)
|
||||
set(SDL_EXTRA_LDFLAGS)
|
||||
|
||||
set(CMAKE_DEPENDS)
|
||||
set(PKGCONFIG_DEPENDS)
|
||||
set(SDL_CMAKE_DEPENDS)
|
||||
set(SDL_PC_PRIVATE_REQUIRES)
|
||||
|
||||
# The sdl-build-options interface library collects all PRIVATE build options for the SDL libraries
|
||||
add_library(sdl-build-options INTERFACE)
|
||||
|
||||
# The sdl-shared-build-options interface library collects all PRIVATE build options for the SDL shared librariy
|
||||
# The sdl-shared-build-options interface library collects all PRIVATE build options for the SDL shared library
|
||||
add_library(sdl-shared-build-options INTERFACE)
|
||||
|
||||
# The sdl-global-options interface library collects all PRIVATE build options for the SDL libraries + test + ...
|
||||
|
@ -1034,14 +1034,14 @@ if(SDL_LIBC)
|
|||
if(HAVE_LIBM)
|
||||
cmake_pop_check_state()
|
||||
if(NOT VITA)
|
||||
list(APPEND EXTRA_LIBS m)
|
||||
list(APPEND SDL_EXTRA_LIBS m)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_SYSTEM_ICONV)
|
||||
check_library_exists(iconv iconv_open "" HAVE_LIBICONV)
|
||||
if(HAVE_LIBICONV)
|
||||
list(APPEND EXTRA_LIBS iconv)
|
||||
list(APPEND SDL_EXTRA_LIBS iconv)
|
||||
set(HAVE_ICONV 1)
|
||||
set(HAVE_SYSTEM_ICONV TRUE)
|
||||
else()
|
||||
|
@ -1187,7 +1187,7 @@ if(ANDROID)
|
|||
file(GLOB OPENSLES_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/openslES/*.c)
|
||||
list(APPEND SOURCE_FILES ${OPENSLES_AUDIO_SOURCES})
|
||||
|
||||
list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} OpenSLES)
|
||||
list(APPEND SDL_EXTRA_LIBS ${ANDROID_DL_LIBRARY} OpenSLES)
|
||||
|
||||
set(SDL_AUDIO_DRIVER_AAUDIO 1)
|
||||
file(GLOB AAUDIO_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/aaudio/*.c)
|
||||
|
@ -1254,7 +1254,7 @@ if(ANDROID)
|
|||
# Core stuff
|
||||
# find_library(ANDROID_DL_LIBRARY dl)
|
||||
# FIXME failing dlopen https://github.com/android-ndk/ndk/issues/929
|
||||
list(APPEND EXTRA_LIBS dl log android)
|
||||
list(APPEND SDL_EXTRA_LIBS dl log android)
|
||||
target_compile_definitions(sdl-build-options INTERFACE "GL_GLEXT_PROTOTYPES")
|
||||
|
||||
#enable gles
|
||||
|
@ -1265,7 +1265,7 @@ if(ANDROID)
|
|||
set(SDL_VIDEO_OPENGL_ES2 1)
|
||||
set(SDL_VIDEO_RENDER_OGL_ES2 1)
|
||||
|
||||
list(APPEND EXTRA_LIBS GLESv1_CM GLESv2)
|
||||
list(APPEND SDL_EXTRA_LIBS GLESv1_CM GLESv2)
|
||||
endif()
|
||||
|
||||
if(SDL_VULKAN)
|
||||
|
@ -1504,7 +1504,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||
if(INOTIFY_FOUND)
|
||||
set(HAVE_INOTIFY 1)
|
||||
target_include_directories(sdl-build-options INTERFACE "${INOTIFY_INCLUDE_DIRS}")
|
||||
list(APPEND EXTRA_LIBS ${INOTIFY_LIBRARIES})
|
||||
list(APPEND SDL_EXTRA_LIBS ${INOTIFY_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -1576,7 +1576,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||
if(SDL_CLOCK_GETTIME)
|
||||
check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT)
|
||||
if(FOUND_CLOCK_GETTIME_LIBRT)
|
||||
list(APPEND EXTRA_LIBS rt)
|
||||
list(APPEND SDL_EXTRA_LIBS rt)
|
||||
set(HAVE_CLOCK_GETTIME 1)
|
||||
else()
|
||||
check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC)
|
||||
|
@ -1851,11 +1851,11 @@ elseif(WINDOWS)
|
|||
|
||||
# Libraries for Win32 native and MinGW
|
||||
if(NOT WINDOWS_STORE)
|
||||
list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32)
|
||||
list(APPEND SDL_EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32)
|
||||
endif()
|
||||
|
||||
if(WINDOWS_STORE)
|
||||
list(APPEND EXTRA_LIBS
|
||||
list(APPEND SDL_EXTRA_LIBS
|
||||
-nodefaultlib:vccorlib$<$<CONFIG:Debug>:d>
|
||||
-nodefaultlib:msvcrt$<$<CONFIG:Debug>:d>
|
||||
vccorlib$<$<CONFIG:Debug>:d>.lib
|
||||
|
@ -1914,7 +1914,7 @@ elseif(WINDOWS)
|
|||
endif()
|
||||
if(HAVE_DINPUT_H)
|
||||
set(SDL_JOYSTICK_DINPUT 1)
|
||||
list(APPEND EXTRA_LIBS dinput8)
|
||||
list(APPEND SDL_EXTRA_LIBS dinput8)
|
||||
endif()
|
||||
if(HAVE_XINPUT_H)
|
||||
if(NOT WINDOWS_STORE)
|
||||
|
@ -2163,71 +2163,71 @@ elseif(APPLE)
|
|||
|
||||
# Actually load the frameworks at the end so we don't duplicate include.
|
||||
if(SDL_FRAMEWORK_COREVIDEO)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreVideo")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,CoreVideo")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COCOA)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Cocoa")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,Cocoa")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_IOKIT)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,IOKit")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,IOKit")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_FF)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,ForceFeedback")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,ForceFeedback")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_CARBON)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Carbon")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,Carbon")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREAUDIO)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreAudio")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,CoreAudio")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_AUDIOTOOLBOX)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AudioToolbox")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,AudioToolbox")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_AVFOUNDATION)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AVFoundation")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,AVFoundation")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREBLUETOOTH)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,CoreBluetooth")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREGRAPHICS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreGraphics")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,CoreGraphics")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREMOTION)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreMotion")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,CoreMotion")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_FOUNDATION)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Foundation")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,Foundation")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_GAMECONTROLLER)
|
||||
find_library(GAMECONTROLLER GameController)
|
||||
if(GAMECONTROLLER)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,GameController")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-weak_framework,GameController")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_METAL)
|
||||
if(IOS OR TVOS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Metal")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,Metal")
|
||||
else()
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,Metal")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-weak_framework,Metal")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_OPENGLES)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,OpenGLES")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,OpenGLES")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_QUARTZCORE)
|
||||
if(IOS OR TVOS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,QuartzCore")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,QuartzCore")
|
||||
else()
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-weak_framework,QuartzCore")
|
||||
endif()
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_UIKIT)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-framework,UIKit")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-framework,UIKit")
|
||||
endif()
|
||||
if(SDL_FRAMEWORK_COREHAPTICS)
|
||||
find_library(COREHAPTICS CoreHaptics)
|
||||
if(COREHAPTICS)
|
||||
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
||||
list(APPEND SDL_EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -2265,7 +2265,7 @@ elseif(HAIKU)
|
|||
set(SDL_VIDEO_OPENGL 1)
|
||||
set(SDL_VIDEO_OPENGL_HAIKU 1)
|
||||
set(SDL_VIDEO_RENDER_OGL 1)
|
||||
list(APPEND EXTRA_LIBS GL)
|
||||
list(APPEND SDL_EXTRA_LIBS GL)
|
||||
set(HAVE_OPENGL TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -2301,7 +2301,7 @@ elseif(HAIKU)
|
|||
list(APPEND SOURCE_FILES ${HAIKU_CORE_SOURCES})
|
||||
|
||||
CheckPTHREAD()
|
||||
list(APPEND EXTRA_LIBS root be media game device textencoding)
|
||||
list(APPEND SDL_EXTRA_LIBS root be media game device textencoding)
|
||||
|
||||
elseif(RISCOS)
|
||||
if(SDL_MISC)
|
||||
|
@ -2419,7 +2419,7 @@ elseif(VITA)
|
|||
|
||||
if(HAVE_PIGS_IN_BLANKET_H)
|
||||
set(SDL_VIDEO_OPENGL_ES2 1)
|
||||
list(APPEND EXTRA_LIBS
|
||||
list(APPEND SDL_EXTRA_LIBS
|
||||
pib
|
||||
)
|
||||
set(HAVE_VIDEO_VITA_PIB ON)
|
||||
|
@ -2440,7 +2440,7 @@ elseif(VITA)
|
|||
set(SDL_VIDEO_OPENGL_ES2 1)
|
||||
set(SDL_VIDEO_RENDER_OGL_ES2 1)
|
||||
|
||||
list(APPEND EXTRA_LIBS
|
||||
list(APPEND SDL_EXTRA_LIBS
|
||||
libgpu_es4_ext_stub_weak
|
||||
libIMGEGL_stub_weak
|
||||
)
|
||||
|
@ -2452,7 +2452,7 @@ elseif(VITA)
|
|||
set(HAVE_OPENGL TRUE)
|
||||
set(SDL_VIDEO_OPENGL 1)
|
||||
set(SDL_VIDEO_RENDER_OGL 1)
|
||||
list(APPEND EXTRA_LIBS libGL_stub)
|
||||
list(APPEND SDL_EXTRA_LIBS libGL_stub)
|
||||
set(SDL_VIDEO_VITA_PVR_OGL 1)
|
||||
endif()
|
||||
|
||||
|
@ -2463,7 +2463,7 @@ elseif(VITA)
|
|||
|
||||
set(SDL_VIDEO_RENDER_VITA_GXM 1)
|
||||
|
||||
list(APPEND EXTRA_LIBS
|
||||
list(APPEND SDL_EXTRA_LIBS
|
||||
SceGxm_stub
|
||||
SceDisplay_stub
|
||||
SceCtrl_stub
|
||||
|
@ -2484,7 +2484,7 @@ elseif(VITA)
|
|||
m
|
||||
)
|
||||
if(HAVE_VITA_PIB)
|
||||
list(PREPEND EXTRA_LIBS
|
||||
list(PREPEND SDL_EXTRA_LIBS
|
||||
pib
|
||||
libScePiglet_stub
|
||||
SceShaccCg_stub
|
||||
|
@ -2492,7 +2492,7 @@ elseif(VITA)
|
|||
)
|
||||
endif()
|
||||
if(HAVE_VITA_PVR)
|
||||
list(PREPEND EXTRA_LIBS
|
||||
list(PREPEND SDL_EXTRA_LIBS
|
||||
SceIme_stub
|
||||
)
|
||||
endif()
|
||||
|
@ -2564,7 +2564,7 @@ elseif(PSP)
|
|||
set(HAVE_SDL_VIDEO TRUE)
|
||||
endif()
|
||||
|
||||
list(APPEND EXTRA_LIBS
|
||||
list(APPEND SDL_EXTRA_LIBS
|
||||
GL
|
||||
pspvram
|
||||
pspaudio
|
||||
|
@ -2623,7 +2623,7 @@ elseif(PS2)
|
|||
set(HAVE_SDL_VIDEO TRUE)
|
||||
endif()
|
||||
|
||||
list(APPEND EXTRA_LIBS
|
||||
list(APPEND SDL_EXTRA_LIBS
|
||||
patches
|
||||
gskit
|
||||
dmakit
|
||||
|
@ -2823,11 +2823,11 @@ file(GENERATE
|
|||
INPUT "${SDL3_BINARY_DIR}/SDL_build_config.h.intermediate")
|
||||
|
||||
# Prepare the flags and remove duplicates
|
||||
if(EXTRA_LDFLAGS)
|
||||
list(REMOVE_DUPLICATES EXTRA_LDFLAGS)
|
||||
if(SDL_EXTRA_LDFLAGS)
|
||||
list(REMOVE_DUPLICATES SDL_EXTRA_LDFLAGS)
|
||||
endif()
|
||||
if(EXTRA_LIBS)
|
||||
list(REMOVE_DUPLICATES EXTRA_LIBS)
|
||||
if(SDL_EXTRA_LIBS)
|
||||
list(REMOVE_DUPLICATES SDL_EXTRA_LIBS)
|
||||
endif()
|
||||
if(EXTRA_CFLAGS)
|
||||
list(REMOVE_DUPLICATES EXTRA_CFLAGS)
|
||||
|
@ -2895,12 +2895,13 @@ else()
|
|||
endif()
|
||||
|
||||
# Clean up the different lists
|
||||
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
|
||||
set(SDL_PC_STATIC_LIBS ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
|
||||
listtostr(SDL_EXTRA_LIBS EXTRA_LIBS_L "-l")
|
||||
set(SDL_PC_STATIC_LIBS ${SDL_EXTRA_LDFLAGS} ${EXTRA_LIBS_L})
|
||||
list(REMOVE_DUPLICATES SDL_PC_STATIC_LIBS)
|
||||
listtostr(SDL_PC_STATIC_LIBS SDL_PC_STATIC_LIBS)
|
||||
listtostr(SDL_PC_LIBS SDL_PC_LIBS)
|
||||
listtostr(SDL_PC_CFLAGS SDL_PC_CFLAGS)
|
||||
listtostr(SDL_PC_PRIVATE_REQUIRES SDL_PC_PRIVATE_REQUIRES)
|
||||
string(REGEX REPLACE "-lSDL3( |$)" "-l${sdl_static_libname} " SDL_PC_STATIC_LIBS "${SDL_PC_STATIC_LIBS}")
|
||||
if(NOT SDL_SHARED)
|
||||
string(REGEX REPLACE "-lSDL3( |$)" "-l${sdl_static_libname} " SDL_PC_LIBS "${SDL_PC_LIBS}")
|
||||
|
@ -3015,10 +3016,14 @@ get_property(INFO_CHECKS TARGET sdl-global-options PROPERTY INTERFACE_COMPILE_OP
|
|||
list(REMOVE_DUPLICATES INFO_CHECKS)
|
||||
listtostr(INFO_CHECKS INFO_CHECKS)
|
||||
|
||||
listtostr(SDL_EXTRA_LDFLAGS INFO_EXTRA_LDFLAGS)
|
||||
|
||||
get_property(INFO_SHARED_LDFLAGS TARGET sdl-shared-build-options PROPERTY INTERFACE_LINK_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES INFO_SHARED_LDFLAGS)
|
||||
listtostr(INFO_SHARED_LDFLAGS INFO_SHARED_LDFLAGS)
|
||||
|
||||
listtostr(SDL_EXTRA_LIBS INFO_EXTRA_LIBS)
|
||||
|
||||
##### Info output #####
|
||||
message(STATUS "")
|
||||
message(STATUS "SDL3 was configured with the following options:")
|
||||
|
@ -3052,8 +3057,8 @@ endif()
|
|||
message(STATUS " EXTRA DEFS: ${INFO_DEFS}")
|
||||
message(STATUS " EXTRA CFLAGS: ${INFO_CFLAGS} ${INFO_CHECKS}")
|
||||
message(STATUS " EXTRA INCDIRS: ${INFO_INCDIRS}")
|
||||
message(STATUS " EXTRA_LDFLAGS: ${EXTRA_LDFLAGS} ${INFO_SHARED_LDFLAGS}")
|
||||
message(STATUS " EXTRA_LIBS: ${EXTRA_LIBS}")
|
||||
message(STATUS " EXTRA LDFLAGS: ${INFO_SHARED_LDFLAGS} ${INFO_EXTRA_LDFLAGS}")
|
||||
message(STATUS " EXTRA LIBS: ${INFO_EXTRA_LIBS}")
|
||||
message(STATUS "")
|
||||
message(STATUS " Build Shared Library: ${SDL_SHARED}")
|
||||
message(STATUS " Build Static Library: ${SDL_STATIC}")
|
||||
|
@ -3157,8 +3162,8 @@ if(SDL_SHARED)
|
|||
endif()
|
||||
set_target_properties(SDL3 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
|
||||
endif()
|
||||
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
|
||||
target_link_libraries(SDL3 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_DEPENDS})
|
||||
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for SDL_EXTRA_LDFLAGS
|
||||
target_link_libraries(SDL3 PRIVATE ${SDL_EXTRA_LIBS} ${SDL_EXTRA_LDFLAGS} ${SDL_CMAKE_DEPENDS})
|
||||
target_include_directories(SDL3
|
||||
PRIVATE
|
||||
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
||||
|
@ -3196,7 +3201,7 @@ if(SDL_STATIC)
|
|||
POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}"
|
||||
)
|
||||
target_compile_definitions(SDL3-static PRIVATE SDL_STATIC_LIB)
|
||||
target_link_libraries(SDL3-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_DEPENDS})
|
||||
target_link_libraries(SDL3-static PRIVATE ${SDL_EXTRA_LIBS} ${SDL_EXTRA_LDFLAGS} ${SDL_CMAKE_DEPENDS})
|
||||
target_include_directories(SDL3-static
|
||||
PRIVATE
|
||||
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
||||
|
|
|
@ -8,7 +8,7 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
|
|||
Name: sdl3
|
||||
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
|
||||
Version: @SDL_VERSION@
|
||||
Requires.private: @PKGCONFIG_DEPENDS@
|
||||
Requires.private: @SDL_PC_PRIVATE_REQUIRES@
|
||||
Conflicts:
|
||||
Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_PC_LIBS@ @PKGCONFIG_LIBS_PRIV@ @SDL_PC_STATIC_LIBS@
|
||||
Cflags: -I${includedir} -I${includedir}/SDL3 @SDL_PC_CFLAGS@
|
||||
|
|
|
@ -49,7 +49,7 @@ macro(CheckDLOPEN)
|
|||
check_symbol_exists(dlopen "dlfcn.h" HAVE_DLOPEN_IN_LIBDL)
|
||||
cmake_pop_check_state()
|
||||
if(HAVE_DLOPEN_IN_LIBDL)
|
||||
list(APPEND EXTRA_LIBS dl)
|
||||
list(APPEND SDL_EXTRA_LIBS dl)
|
||||
endif()
|
||||
endif()
|
||||
if(HAVE_DLOPEN_IN_LIBC OR HAVE_DLOPEN_IN_LIBDL)
|
||||
|
@ -78,7 +78,7 @@ macro(CheckOSS)
|
|||
set(SDL_AUDIO_DRIVER_OSS 1)
|
||||
list(APPEND SOURCE_FILES ${OSS_SOURCES})
|
||||
if(NETBSD)
|
||||
list(APPEND EXTRA_LIBS ossaudio)
|
||||
list(APPEND SDL_EXTRA_LIBS ossaudio)
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
|
@ -114,8 +114,8 @@ macro(CheckALSA)
|
|||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_ALSA_SHARED)
|
||||
list(APPEND CMAKE_DEPENDS ALSA::ALSA)
|
||||
list(APPEND PKGCONFIG_DEPENDS alsa)
|
||||
list(APPEND SDL_CMAKE_DEPENDS ALSA::ALSA)
|
||||
list(APPEND SDL_PC_PRIVATE_REQUIRES alsa)
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
|
@ -147,7 +147,7 @@ macro(CheckPipewire)
|
|||
set(SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC "\"${PIPEWIRE_0.3_LIB_SONAME}\"")
|
||||
set(HAVE_PIPEWIRE_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LDFLAGS ${PKG_PIPEWIRE_LDFLAGS})
|
||||
list(APPEND SDL_EXTRA_LDFLAGS ${PKG_PIPEWIRE_LDFLAGS})
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
|
@ -176,7 +176,7 @@ macro(CheckPulseAudio)
|
|||
set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${PULSE_SIMPLE_LIB_SONAME}\"")
|
||||
set(HAVE_PULSEAUDIO_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS})
|
||||
list(APPEND SDL_EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS})
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
|
@ -205,7 +205,7 @@ macro(CheckJACK)
|
|||
set(SDL_AUDIO_DRIVER_JACK_DYNAMIC "\"${JACK_LIB_SONAME}\"")
|
||||
set(HAVE_JACK_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LDFLAGS ${PKG_JACK_LDFLAGS})
|
||||
list(APPEND SDL_EXTRA_LDFLAGS ${PKG_JACK_LDFLAGS})
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
|
@ -234,7 +234,7 @@ macro(CheckSNDIO)
|
|||
set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"")
|
||||
set(HAVE_SNDIO_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${PKG_SNDIO_LDFLAGS})
|
||||
list(APPEND SDL_EXTRA_LIBS ${PKG_SNDIO_LDFLAGS})
|
||||
endif()
|
||||
set(HAVE_SDL_AUDIO TRUE)
|
||||
endif()
|
||||
|
@ -283,7 +283,7 @@ macro(CheckLibSampleRate)
|
|||
set(SDL_LIBSAMPLERATE_DYNAMIC "\"${SAMPLERATE_LIB_SONAME}\"")
|
||||
set(HAVE_LIBSAMPLERATE_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LDFLAGS -lsamplerate)
|
||||
list(APPEND SDL_EXTRA_LDFLAGS -lsamplerate)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@ -353,7 +353,7 @@ macro(CheckX11)
|
|||
if(NOT HAVE_SHMAT_IN_LIBC)
|
||||
check_library_exists(ipc shmat "" HAVE_SHMAT_IN_LIBIPC)
|
||||
if(HAVE_SHMAT_IN_LIBIPC)
|
||||
list(APPEND EXTRA_LIBS ipc)
|
||||
list(APPEND SDL_EXTRA_LIBS ipc)
|
||||
endif()
|
||||
if(NOT HAVE_SHMAT_IN_LIBIPC)
|
||||
target_compile_definitions(sdl-build-options INTERFACE "NO_SHARED_MEMORY")
|
||||
|
@ -371,18 +371,18 @@ macro(CheckX11)
|
|||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC "\"${X11_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${X11_LIB})
|
||||
list(APPEND SDL_EXTRA_LIBS ${X11_LIB})
|
||||
endif()
|
||||
endif()
|
||||
if(XEXT_LIB)
|
||||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${XEXT_LIB_SONAME})
|
||||
list(APPEND SDL_EXTRA_LIBS ${XEXT_LIB_SONAME})
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB})
|
||||
list(APPEND SDL_EXTRA_LIBS ${X11_LIB} ${XEXT_LIB})
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${X11_LIB})
|
||||
|
@ -408,7 +408,7 @@ macro(CheckX11)
|
|||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${XCURSOR_LIB})
|
||||
list(APPEND SDL_EXTRA_LIBS ${XCURSOR_LIB})
|
||||
endif()
|
||||
set(SDL_VIDEO_DRIVER_X11_XCURSOR 1)
|
||||
endif()
|
||||
|
@ -423,7 +423,7 @@ macro(CheckX11)
|
|||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${XI_LIB})
|
||||
list(APPEND SDL_EXTRA_LIBS ${XI_LIB})
|
||||
endif()
|
||||
set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
|
||||
|
||||
|
@ -457,7 +457,7 @@ macro(CheckX11)
|
|||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES "\"${XFIXES_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${XFIXES_LIB})
|
||||
list(APPEND SDL_EXTRA_LIBS ${XFIXES_LIB})
|
||||
endif()
|
||||
set(SDL_VIDEO_DRIVER_X11_XFIXES 1)
|
||||
set(HAVE_X11_XFIXES TRUE)
|
||||
|
@ -467,7 +467,7 @@ macro(CheckX11)
|
|||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${XRANDR_LIB})
|
||||
list(APPEND SDL_EXTRA_LIBS ${XRANDR_LIB})
|
||||
endif()
|
||||
set(SDL_VIDEO_DRIVER_X11_XRANDR 1)
|
||||
set(HAVE_X11_XRANDR TRUE)
|
||||
|
@ -477,7 +477,7 @@ macro(CheckX11)
|
|||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${XSS_LIB})
|
||||
list(APPEND SDL_EXTRA_LIBS ${XSS_LIB})
|
||||
endif()
|
||||
set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1)
|
||||
set(HAVE_X11_XSCRNSAVER TRUE)
|
||||
|
@ -591,7 +591,7 @@ macro(CheckWayland)
|
|||
set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON "\"${XKBCOMMON_LIB_SONAME}\"")
|
||||
set(HAVE_WAYLAND_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${PKG_WAYLAND_LIBRARIES})
|
||||
list(APPEND SDL_EXTRA_LIBS ${PKG_WAYLAND_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(SDL_WAYLAND_LIBDECOR)
|
||||
|
@ -609,7 +609,7 @@ macro(CheckWayland)
|
|||
set(HAVE_WAYLAND_LIBDECOR_SHARED TRUE)
|
||||
set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR "\"${DECOR_0_LIB_SONAME}\"")
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${PKG_LIBDECOR_LIBRARIES})
|
||||
list(APPEND SDL_EXTRA_LIBS ${PKG_LIBDECOR_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@ -659,10 +659,10 @@ macro(CheckVivante)
|
|||
set(SDL_VIDEO_DRIVER_VIVANTE_VDK 1)
|
||||
find_library(VIVANTE_LIBRARY REQUIRED NAMES VIVANTE vivante drm_vivante)
|
||||
find_library(VIVANTE_VDK_LIBRARY VDK REQUIRED)
|
||||
list(APPEND EXTRA_LIBS ${VIVANTE_LIBRARY} ${VIVANTE_VDK_LIBRARY})
|
||||
list(APPEND SDL_EXTRA_LIBS ${VIVANTE_LIBRARY} ${VIVANTE_VDK_LIBRARY})
|
||||
else()
|
||||
list(APPEND SDL_PC_CFLAGS -DLINUX -DEGL_API_FB)
|
||||
list(APPEND EXTRA_LIBS EGL)
|
||||
list(APPEND SDL_EXTRA_LIBS EGL)
|
||||
endif(HAVE_VIVANTE_VDK)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -807,7 +807,7 @@ macro(CheckPTHREAD)
|
|||
if(HAVE_PTHREADS)
|
||||
set(SDL_THREAD_PTHREAD 1)
|
||||
target_compile_options(sdl-build-options INTERFACE ${PTHREAD_CFLAGS})
|
||||
list(APPEND EXTRA_LDFLAGS ${PTHREAD_LDFLAGS})
|
||||
list(APPEND SDL_EXTRA_LDFLAGS ${PTHREAD_LDFLAGS})
|
||||
list(APPEND SDL_PC_CFLAGS ${PTHREAD_CFLAGS})
|
||||
|
||||
check_c_source_compiles("
|
||||
|
@ -1015,7 +1015,7 @@ macro(CheckUSBHID)
|
|||
file(GLOB BSD_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/bsd/*.c)
|
||||
list(APPEND SOURCE_FILES ${BSD_JOYSTICK_SOURCES})
|
||||
target_compile_options(sdl-build-options INTERFACE ${USB_CFLAGS})
|
||||
list(APPEND EXTRA_LIBS ${USB_LIBS})
|
||||
list(APPEND SDL_EXTRA_LIBS ${USB_LIBS})
|
||||
set(HAVE_SDL_JOYSTICK TRUE)
|
||||
|
||||
endif()
|
||||
|
@ -1035,9 +1035,9 @@ macro(CheckHIDAPI)
|
|||
set(HAVE_LIBUSB TRUE)
|
||||
target_compile_options(sdl-build-options INTERFACE ${PKG_LIBUSB_CFLAGS})
|
||||
if(HIDAPI_ONLY_LIBUSB)
|
||||
list(APPEND EXTRA_LIBS ${PKG_LIBUSB_LIBRARIES})
|
||||
list(APPEND SDL_EXTRA_LIBS ${PKG_LIBUSB_LIBRARIES})
|
||||
else()
|
||||
# libusb is loaded dynamically, so don't add it to EXTRA_LIBS
|
||||
# libusb is loaded dynamically, so don't add it to SDL_EXTRA_LIBS
|
||||
FindLibraryAndSONAME("usb-1.0" LIBDIRS ${PKG_LIBUSB_LIBRARY_DIRS})
|
||||
if(USB_1.0_LIB)
|
||||
set(SDL_LIBUSB_DYNAMIC "\"${USB_1.0_LIB_SONAME}\"")
|
||||
|
@ -1107,9 +1107,9 @@ macro(CheckRPI)
|
|||
set(SDL_VIDEO_DRIVER_RPI 1)
|
||||
file(GLOB VIDEO_RPI_SOURCES ${SDL3_SOURCE_DIR}/src/video/raspberry/*.c)
|
||||
list(APPEND SOURCE_FILES ${VIDEO_RPI_SOURCES})
|
||||
list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
|
||||
list(APPEND SDL_EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
|
||||
target_compile_options(sdl-build-options INTERFACE ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS})
|
||||
list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS})
|
||||
list(APPEND SDL_EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS})
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
@ -1161,7 +1161,7 @@ macro(CheckKMSDRM)
|
|||
set(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM "\"${GBM_LIB_SONAME}\"")
|
||||
set(HAVE_KMSDRM_SHARED TRUE)
|
||||
else()
|
||||
list(APPEND EXTRA_LIBS ${PKG_KMSDRM_LIBRARIES})
|
||||
list(APPEND SDL_EXTRA_LIBS ${PKG_KMSDRM_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue