mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 11:11:35 +02:00
Update SDL to version 2.0.14.
This commit is contained in:
@@ -30,7 +30,7 @@ macro(FindLibraryAndSONAME _LIB)
|
||||
endmacro()
|
||||
|
||||
macro(CheckDLOPEN)
|
||||
check_function_exists(dlopen HAVE_DLOPEN)
|
||||
check_symbol_exists(dlopen "dlfcn.h" HAVE_DLOPEN)
|
||||
if(NOT HAVE_DLOPEN)
|
||||
foreach(_LIBNAME dl tdl)
|
||||
check_library_exists("${_LIBNAME}" "dlopen" "" DLOPEN_LIB)
|
||||
@@ -424,7 +424,7 @@ macro(CheckX11)
|
||||
set(X11_SHARED OFF)
|
||||
endif()
|
||||
|
||||
check_function_exists("shmat" HAVE_SHMAT)
|
||||
check_symbol_exists(shmat "sys/shm.h" HAVE_SHMAT)
|
||||
if(NOT HAVE_SHMAT)
|
||||
check_library_exists(ipc shmat "" HAVE_SHMAT)
|
||||
if(HAVE_SHMAT)
|
||||
@@ -476,7 +476,7 @@ macro(CheckX11)
|
||||
set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1)
|
||||
endif()
|
||||
|
||||
check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)
|
||||
check_symbol_exists(XkbKeycodeToKeysym "X11/Xlib.h;X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)
|
||||
|
||||
if(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H)
|
||||
set(HAVE_VIDEO_X11_XCURSOR TRUE)
|
||||
@@ -593,7 +593,7 @@ endmacro()
|
||||
# - HAVE_DLOPEN opt
|
||||
macro(CheckWayland)
|
||||
if(VIDEO_WAYLAND)
|
||||
pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon)
|
||||
pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-egl wayland-cursor egl xkbcommon)
|
||||
|
||||
if(WAYLAND_FOUND)
|
||||
execute_process(
|
||||
@@ -633,6 +633,7 @@ macro(CheckWayland)
|
||||
endforeach()
|
||||
|
||||
if(VIDEO_WAYLAND_QT_TOUCH)
|
||||
set(HAVE_VIDEO_WAYLAND_QT_TOUCH TRUE)
|
||||
set(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 1)
|
||||
endif()
|
||||
|
||||
@@ -757,8 +758,10 @@ macro(CheckOpenGLX11)
|
||||
endmacro()
|
||||
|
||||
# Requires:
|
||||
# - nada
|
||||
# - PkgCheckModules
|
||||
macro(CheckOpenGLESX11)
|
||||
pkg_check_modules(EGL egl)
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${EGL_CFLAGS}")
|
||||
if(VIDEO_OPENGLES)
|
||||
check_c_source_compiles("
|
||||
#define EGL_API_FB
|
||||
@@ -899,12 +902,14 @@ macro(CheckPTHREAD)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_c_source_compiles("
|
||||
#include <pthread.h>
|
||||
#include <pthread_np.h>
|
||||
int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H)
|
||||
check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
|
||||
check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP)
|
||||
check_include_files("pthread.h" HAVE_PTHREAD_H)
|
||||
check_include_files("pthread_np.h" HAVE_PTHREAD_NP_H)
|
||||
if (HAVE_PTHREAD_H)
|
||||
check_symbol_exists(pthread_setname_np "pthread.h" HAVE_PTHREAD_SETNAME_NP)
|
||||
if (HAVE_PTHREAD_NP_H)
|
||||
check_symbol_exists(pthread_set_name_np "pthread.h;pthread_np.h" HAVE_PTHREAD_SET_NAME_NP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(SOURCE_FILES ${SOURCE_FILES}
|
||||
${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c
|
||||
@@ -968,8 +973,8 @@ macro(CheckUSBHID)
|
||||
#include <usb.h>
|
||||
#endif
|
||||
#ifdef __DragonFly__
|
||||
# include <bus/usb/usb.h>
|
||||
# include <bus/usb/usbhid.h>
|
||||
# include <bus/u4b/usb.h>
|
||||
# include <bus/u4b/usbhid.h>
|
||||
#else
|
||||
# include <dev/usb/usb.h>
|
||||
# include <dev/usb/usbhid.h>
|
||||
@@ -994,8 +999,8 @@ macro(CheckUSBHID)
|
||||
#include <usb.h>
|
||||
#endif
|
||||
#ifdef __DragonFly__
|
||||
# include <bus/usb/usb.h>
|
||||
# include <bus/usb/usbhid.h>
|
||||
# include <bus/u4b/usb.h>
|
||||
# include <bus/u4b/usbhid.h>
|
||||
#else
|
||||
# include <dev/usb/usb.h>
|
||||
# include <dev/usb/usbhid.h>
|
||||
@@ -1022,8 +1027,8 @@ macro(CheckUSBHID)
|
||||
#include <usb.h>
|
||||
#endif
|
||||
#ifdef __DragonFly__
|
||||
#include <bus/usb/usb.h>
|
||||
#include <bus/usb/usbhid.h>
|
||||
#include <bus/u4b/usb.h>
|
||||
#include <bus/u4b/usbhid.h>
|
||||
#else
|
||||
#include <dev/usb/usb.h>
|
||||
#include <dev/usb/usbhid.h>
|
||||
@@ -1072,9 +1077,9 @@ macro(CheckHIDAPI)
|
||||
set(HAVE_HIDAPI TRUE)
|
||||
else()
|
||||
set(HAVE_HIDAPI FALSE)
|
||||
pkg_check_modules(LIBUSB libusb)
|
||||
pkg_check_modules(LIBUSB libusb-1.0)
|
||||
if (LIBUSB_FOUND)
|
||||
check_include_file(libusb.h HAVE_LIBUSB_H)
|
||||
check_include_file(libusb.h HAVE_LIBUSB_H ${LIBUSB_CFLAGS})
|
||||
if (HAVE_LIBUSB_H)
|
||||
set(HAVE_HIDAPI TRUE)
|
||||
endif()
|
||||
@@ -1086,10 +1091,17 @@ macro(CheckHIDAPI)
|
||||
set(HAVE_SDL_JOYSTICK TRUE)
|
||||
file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${HIDAPI_SOURCES})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} -I${SDL2_SOURCE_DIR}/src/hidapi/hidapi")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} \"-I${SDL2_SOURCE_DIR}/src/hidapi/hidapi\"")
|
||||
if(NOT HIDAPI_SKIP_LIBUSB)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
|
||||
list(APPEND EXTRA_LIBS ${LIBUSB_LIBS})
|
||||
if(HIDAPI_ONLY_LIBUSB)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
|
||||
list(APPEND EXTRA_LIBS ${LIBUSB_LIBS})
|
||||
else()
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/SDL_hidapi.c)
|
||||
# libusb is loaded dynamically, so don't add it to EXTRA_LIBS
|
||||
FindLibraryAndSONAME("usb-1.0")
|
||||
set(SDL_LIBUSB_DYNAMIC "\"${USB_LIB_SONAME}\"")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -1151,7 +1163,8 @@ macro(CheckKMSDRM)
|
||||
set(HAVE_SDL_VIDEO TRUE)
|
||||
|
||||
file(GLOB KMSDRM_SOURCES ${SDL2_SOURCE_DIR}/src/video/kmsdrm/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${KMSDRM_SOURCES})
|
||||
file(GLOB KMSDRM_LEGACY_SOURCES ${SDL2_SOURCE_DIR}/src/video/kmsdrm_legacy/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${KMSDRM_SOURCES} ${KMSDRM_LEGACY_SOURCES})
|
||||
|
||||
list(APPEND EXTRA_CFLAGS ${KMSDRM_CFLAGS})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user