mirror of
https://github.com/love2d/megasource.git
synced 2026-08-20 12:40:06 +02:00
update SDL3 to latest commit
This commit is contained in:
@@ -30,10 +30,12 @@ endmacro()
|
||||
|
||||
set(SDL3_FOUND TRUE)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P STREQUAL "4")
|
||||
if(SDL_CPU_X86)
|
||||
set(_sdl_arch_subdir "x86")
|
||||
elseif(CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
||||
elseif(SDL_CPU_X64 OR SDL_CPU_ARM64EC)
|
||||
set(_sdl_arch_subdir "x64")
|
||||
elseif(SDL_CPU_ARM64)
|
||||
set(_sdl_arch_subdir "arm64")
|
||||
else()
|
||||
set(SDL3_FOUND FALSE)
|
||||
return()
|
||||
@@ -41,11 +43,11 @@ endif()
|
||||
|
||||
get_filename_component(_sdl3_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
|
||||
set_and_check(_sdl3_prefix "${_sdl3_prefix}")
|
||||
set(_sdl3_include_dirs "${_sdl3_prefix}/include;${_sdl3_prefix}/include/SDL3")
|
||||
set(_sdl3_include_dirs "${_sdl3_prefix}/include")
|
||||
|
||||
set(_sdl3_library "${_sdl3_prefix}/lib/${_sdl_arch_subdir}/SDL3.lib")
|
||||
set(_sdl3_dll_library "${_sdl3_prefix}/lib/${_sdl_arch_subdir}/SDL3.dll")
|
||||
set(_sdl3test_library "${_sdl3_prefix}/lib/${_sdl_arch_subdir}/SDL3_test.lib")
|
||||
set(_sdl3_implib "${_sdl3_prefix}/lib/${_sdl_arch_subdir}/SDL3.lib")
|
||||
set(_sdl3_dll "${_sdl3_prefix}/lib/${_sdl_arch_subdir}/SDL3.dll")
|
||||
set(_sdl3test_lib "${_sdl3_prefix}/lib/${_sdl_arch_subdir}/SDL3_test.lib")
|
||||
|
||||
unset(_sdl_arch_subdir)
|
||||
unset(_sdl3_prefix)
|
||||
@@ -63,14 +65,14 @@ endif()
|
||||
set(SDL3_Headers_FOUND TRUE)
|
||||
unset(_sdl3_include_dirs)
|
||||
|
||||
if(EXISTS "${_sdl3_library}" AND EXISTS "${_sdl3_dll_library}")
|
||||
if(EXISTS "${_sdl3_implib}" AND EXISTS "${_sdl3_dll}")
|
||||
if(NOT TARGET SDL3::SDL3-shared)
|
||||
add_library(SDL3::SDL3-shared SHARED IMPORTED)
|
||||
set_target_properties(SDL3::SDL3-shared
|
||||
PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
|
||||
IMPORTED_IMPLIB "${_sdl3_library}"
|
||||
IMPORTED_LOCATION "${_sdl3_dll_library}"
|
||||
IMPORTED_IMPLIB "${_sdl3_implib}"
|
||||
IMPORTED_LOCATION "${_sdl3_dll}"
|
||||
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
|
||||
INTERFACE_SDL3_SHARED "ON"
|
||||
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||
@@ -81,18 +83,18 @@ if(EXISTS "${_sdl3_library}" AND EXISTS "${_sdl3_dll_library}")
|
||||
else()
|
||||
set(SDL3_SDL3-shared_FOUND FALSE)
|
||||
endif()
|
||||
unset(_sdl3_library)
|
||||
unset(_sdl3_dll_library)
|
||||
unset(_sdl3_implib)
|
||||
unset(_sdl3_dll)
|
||||
|
||||
set(SDL3_SDL3-static_FOUND FALSE)
|
||||
|
||||
if(EXISTS "${_sdl3test_library}")
|
||||
if(EXISTS "${_sdl3test_lib}")
|
||||
if(NOT TARGET SDL3::SDL3_test)
|
||||
add_library(SDL3::SDL3_test STATIC IMPORTED)
|
||||
set_target_properties(SDL3::SDL3_test
|
||||
PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
|
||||
IMPORTED_LOCATION "${_sdl3test_library}"
|
||||
IMPORTED_LOCATION "${_sdl3test_lib}"
|
||||
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
|
||||
INTERFACE_SDL_VERSION "SDL3"
|
||||
)
|
||||
@@ -101,7 +103,7 @@ if(EXISTS "${_sdl3test_library}")
|
||||
else()
|
||||
set(SDL3_SDL3_test_FOUND FALSE)
|
||||
endif()
|
||||
unset(_sdl3test_library)
|
||||
unset(_sdl3test_lib)
|
||||
|
||||
if(SDL3_SDL3-shared_FOUND)
|
||||
set(SDL3_SDL3_FOUND TRUE)
|
||||
|
||||
Reference in New Issue
Block a user