Merge commit '28d94e8b86cef2f86bff054565179fc2027db8cd' into dev
This commit is contained in:
1
external/SDL/cmake/PreseedMSVCCache.cmake
vendored
1
external/SDL/cmake/PreseedMSVCCache.cmake
vendored
@@ -15,6 +15,7 @@ if(MSVC)
|
||||
set(HAVE_MMDEVICEAPI_H "1" CACHE INTERNAL "Have include mmdeviceapi.h")
|
||||
set(HAVE_SENSORSAPI_H "1" CACHE INTERNAL "Have include sensorsapi.h")
|
||||
set(HAVE_SHELLSCALINGAPI_H "1" CACHE INTERNAL "Have include shellscalingapi.h")
|
||||
set(HAVE_SHOBJIDL_CORE_H "1" CACHE INTERNAL "Have include shobjidl_core.h")
|
||||
set(HAVE_TPCSHRD_H "1" CACHE INTERNAL "Have include tpcshrd.h")
|
||||
set(HAVE_WIN32_CC "1" CACHE INTERNAL "Test HAVE_WIN32_CC")
|
||||
set(HAVE_XINPUT_H "1" CACHE INTERNAL "Test HAVE_XINPUT_H")
|
||||
|
||||
5
external/SDL/cmake/SDL3Config.cmake.in
vendored
5
external/SDL/cmake/SDL3Config.cmake.in
vendored
@@ -77,6 +77,9 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT SDL3_COMPONENTS AND NOT TARGET SDL3::Headers AND NOT TARGET SDL3::SDL3-shared AND NOT TARGET SDL3::SDL3-static)
|
||||
set(SDL3_FOUND FALSE)
|
||||
endif()
|
||||
check_required_components(SDL3)
|
||||
|
||||
function(_sdl_create_target_alias_compat NEW_TARGET TARGET)
|
||||
@@ -93,7 +96,7 @@ endfunction()
|
||||
if(NOT TARGET SDL3::SDL3)
|
||||
if(TARGET SDL3::SDL3-shared)
|
||||
_sdl_create_target_alias_compat(SDL3::SDL3 SDL3::SDL3-shared)
|
||||
else()
|
||||
elseif(TARGET SDL3::SDL3-static)
|
||||
_sdl_create_target_alias_compat(SDL3::SDL3 SDL3::SDL3-static)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
21
external/SDL/cmake/macros.cmake
vendored
21
external/SDL/cmake/macros.cmake
vendored
@@ -362,9 +362,6 @@ function(SDL_PrintSummary)
|
||||
message(STATUS "")
|
||||
message(STATUS " Build Shared Library: ${SDL_SHARED}")
|
||||
message(STATUS " Build Static Library: ${SDL_STATIC}")
|
||||
if(SDL_STATIC)
|
||||
message(STATUS " Build Static Library with Position Independent Code: ${SDL_STATIC_PIC}")
|
||||
endif()
|
||||
if(APPLE)
|
||||
message(STATUS " Build libraries as Apple Framework: ${SDL_FRAMEWORK}")
|
||||
endif()
|
||||
@@ -376,24 +373,6 @@ function(SDL_PrintSummary)
|
||||
message(STATUS "")
|
||||
endif()
|
||||
|
||||
if(WARN_ABOUT_ARM_SIMD_ASM_MIT)
|
||||
message(STATUS "SDL is being built with ARM SIMD optimizations, which")
|
||||
message(STATUS "uses code licensed under the MIT license. If this is a")
|
||||
message(STATUS "problem, please disable that code by rerunning CMake with:")
|
||||
message(STATUS "")
|
||||
message(STATUS " -DSDL_ARMSIMD=OFF")
|
||||
message(STATUS "")
|
||||
endif()
|
||||
|
||||
if(WARN_ABOUT_ARM_NEON_ASM_MIT)
|
||||
message(STATUS "SDL is being built with ARM NEON optimizations, which")
|
||||
message(STATUS "uses code licensed under the MIT license. If this is a")
|
||||
message(STATUS "problem, please disable that code by rerunning CMake with:")
|
||||
message(STATUS "")
|
||||
message(STATUS " -DSDL_ARMNEON=OFF")
|
||||
message(STATUS "")
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT (ANDROID OR APPLE OR EMSCRIPTEN OR HAIKU OR RISCOS))
|
||||
if(NOT (HAVE_X11 OR HAVE_WAYLAND))
|
||||
if(NOT SDL_UNIX_CONSOLE_BUILD)
|
||||
|
||||
48
external/SDL/cmake/sdlchecks.cmake
vendored
48
external/SDL/cmake/sdlchecks.cmake
vendored
@@ -1,3 +1,10 @@
|
||||
macro(check_c_source_compiles_static SOURCE VAR)
|
||||
set(saved_CMAKE_TRY_COMPILE_TARGET_TYPE "${CMAKE_TRY_COMPILE_TARGET_TYPE}")
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
|
||||
check_c_source_compiles("${SOURCE}" ${VAR} ${ARGN})
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "${saved_CMAKE_TRY_COMPILE_TARGET_TYPE}")
|
||||
endmacro()
|
||||
|
||||
macro(FindLibraryAndSONAME _LIB)
|
||||
cmake_parse_arguments(_FLAS "" "" "LIBDIRS" ${ARGN})
|
||||
|
||||
@@ -274,10 +281,11 @@ macro(CheckX11)
|
||||
set(Xrandr_PKG_CONFIG_SPEC xrandr)
|
||||
set(Xrender_PKG_CONFIG_SPEC xrender)
|
||||
set(Xss_PKG_CONFIG_SPEC xscrnsaver)
|
||||
set(Xtst_PKG_CONFIG_SPEC xtst)
|
||||
|
||||
find_package(X11)
|
||||
|
||||
foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss)
|
||||
foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss Xtst)
|
||||
get_filename_component(_libdir "${X11_${_LIB}_LIB}" DIRECTORY)
|
||||
FindLibraryAndSONAME("${_LIB}" LIBDIRS ${_libdir})
|
||||
endforeach()
|
||||
@@ -310,6 +318,7 @@ macro(CheckX11)
|
||||
find_file(HAVE_XSYNC_H NAMES "X11/extensions/sync.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XSS_H NAMES "X11/extensions/scrnsaver.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XSHAPE_H NAMES "X11/extensions/shape.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XTEST_H NAMES "X11/extensions/XTest.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XDBE_H NAMES "X11/extensions/Xdbe.h" HINTS "${X11_INCLUDEDIR}")
|
||||
find_file(HAVE_XEXT_H NAMES "X11/extensions/Xext.h" HINTS "${X11_INCLUDEDIR}")
|
||||
|
||||
@@ -367,7 +376,7 @@ macro(CheckX11)
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${X11_LIB})
|
||||
|
||||
check_c_source_compiles("
|
||||
check_c_source_compiles_static("
|
||||
#include <X11/Xlib.h>
|
||||
int main(int argc, char **argv) {
|
||||
Display *display;
|
||||
@@ -408,7 +417,7 @@ macro(CheckX11)
|
||||
set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
|
||||
|
||||
# Check for multitouch
|
||||
check_c_source_compiles("
|
||||
check_c_source_compiles_static("
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/XInput2.h>
|
||||
@@ -425,7 +434,7 @@ macro(CheckX11)
|
||||
|
||||
# check along with XInput2.h because we use Xfixes with XIBarrierReleasePointer
|
||||
if(SDL_X11_XFIXES AND HAVE_XFIXES_H_ AND HAVE_XINPUT2_H)
|
||||
check_c_source_compiles("
|
||||
check_c_source_compiles_static("
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/XInput2.h>
|
||||
@@ -472,6 +481,16 @@ macro(CheckX11)
|
||||
set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
|
||||
set(HAVE_X11_XSHAPE TRUE)
|
||||
endif()
|
||||
|
||||
if(SDL_X11_XTEST AND HAVE_XTEST_H AND XTST_LIB)
|
||||
if(HAVE_X11_SHARED)
|
||||
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST "\"${XTST_LIB_SONAME}\"")
|
||||
else()
|
||||
sdl_link_dependency(xtst LIBS X11::Xtst CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xtst_PKG_CONFIG_SPEC})
|
||||
endif()
|
||||
set(SDL_VIDEO_DRIVER_X11_XTEST 1)
|
||||
set(HAVE_X11_XTEST TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_X11)
|
||||
@@ -823,7 +842,7 @@ macro(CheckPTHREAD)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||
set(PTHREAD_LDFLAGS "-mt -lpthread")
|
||||
else()
|
||||
set(PTHREAD_LDFLAGS "-pthread -lposix4")
|
||||
set(PTHREAD_LDFLAGS "-pthread")
|
||||
endif()
|
||||
elseif(SYSV5)
|
||||
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
|
||||
@@ -1085,7 +1104,7 @@ macro(CheckHIDAPI)
|
||||
if(LibUSB_FOUND)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES LibUSB::LibUSB)
|
||||
check_c_source_compiles("
|
||||
check_c_source_compiles_static("
|
||||
#include <stddef.h>
|
||||
#include <libusb.h>
|
||||
int main(int argc, char **argv) {
|
||||
@@ -1124,6 +1143,7 @@ macro(CheckHIDAPI)
|
||||
set(HAVE_SDL_JOYSTICK TRUE)
|
||||
set(HAVE_HIDAPI_JOYSTICK TRUE)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/hidapi/*.c")
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/haptic/hidapi/*.c")
|
||||
endif()
|
||||
else()
|
||||
set(SDL_HIDAPI_DISABLED 1)
|
||||
@@ -1245,7 +1265,21 @@ endmacro()
|
||||
macro(CheckLibUnwind)
|
||||
if(TARGET SDL3_test)
|
||||
set(found_libunwind FALSE)
|
||||
set(_libunwind_src "#include <libunwind.h>\nint main() {unw_context_t context; unw_getcontext(&context); return 0;}")
|
||||
set(_libunwind_src [==[
|
||||
#include <libunwind.h>
|
||||
int main(int argc, char *argv[]) {
|
||||
(void)argc; (void)argv;
|
||||
unw_context_t context;
|
||||
unw_cursor_t cursor;
|
||||
unw_word_t pc;
|
||||
char sym[256];
|
||||
unw_word_t offset;
|
||||
unw_getcontext(&context);
|
||||
unw_step(&cursor);
|
||||
unw_get_reg(&cursor, UNW_REG_IP, &pc);
|
||||
unw_get_proc_name(&cursor, sym, sizeof(sym), &offset);
|
||||
return 0;
|
||||
}]==])
|
||||
|
||||
if(NOT found_libunwind)
|
||||
cmake_push_check_state()
|
||||
|
||||
6
external/SDL/cmake/sdlcpu.cmake
vendored
6
external/SDL/cmake/sdlcpu.cmake
vendored
@@ -4,15 +4,15 @@ function(SDL_DetectTargetCPUArchitectures DETECTED_ARCHS)
|
||||
|
||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
foreach(known_arch IN LISTS known_archs)
|
||||
set(SDL_CPU_${known_arch} "0")
|
||||
set(SDL_CPU_${known_arch} "0" PARENT_SCOPE)
|
||||
endforeach()
|
||||
set(detected_archs)
|
||||
foreach(osx_arch IN LISTS CMAKE_OSX_ARCHITECTURES)
|
||||
if(osx_arch STREQUAL "x86_64")
|
||||
set(SDL_CPU_X64 "1")
|
||||
set(SDL_CPU_X64 "1" PARENT_SCOPE)
|
||||
list(APPEND detected_archs "X64")
|
||||
elseif(osx_arch STREQUAL "arm64")
|
||||
set(SDL_CPU_ARM64 "1")
|
||||
set(SDL_CPU_ARM64 "1" PARENT_SCOPE)
|
||||
list(APPEND detected_archs "ARM64")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
2
external/SDL/cmake/test/main_cli.c
vendored
2
external/SDL/cmake/test/main_cli.c
vendored
@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_SetMainReady();
|
||||
if (!SDL_Init(0)) {
|
||||
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
|
||||
SDL_Log("Could not initialize SDL: %s", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
SDL_Delay(100);
|
||||
|
||||
4
external/SDL/cmake/test/main_gui.c
vendored
4
external/SDL/cmake/test/main_gui.c
vendored
@@ -6,12 +6,12 @@ int main(int argc, char *argv[])
|
||||
SDL_Window *window = NULL;
|
||||
SDL_Surface *screenSurface = NULL;
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
|
||||
SDL_Log("Could not initialize SDL: %s", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
|
||||
if (!window) {
|
||||
SDL_Log("could not create window: %s\n", SDL_GetError());
|
||||
SDL_Log("could not create window: %s", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
screenSurface = SDL_GetWindowSurface(window);
|
||||
|
||||
2
external/SDL/cmake/test/main_lib.c
vendored
2
external/SDL/cmake/test/main_lib.c
vendored
@@ -18,7 +18,7 @@ int MYLIBRARY_EXPORT mylibrary_work(void);
|
||||
int mylibrary_init(void) {
|
||||
SDL_SetMainReady();
|
||||
if (!SDL_Init(0)) {
|
||||
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
|
||||
SDL_Log("Could not initialize SDL: %s", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user