early-access version 1617
This commit is contained in:
42
externals/SDL/cmake/sdlchecks.cmake
vendored
42
externals/SDL/cmake/sdlchecks.cmake
vendored
@@ -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()
|
||||
|
||||
@@ -901,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
|
||||
@@ -970,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>
|
||||
@@ -996,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>
|
||||
@@ -1024,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>
|
||||
@@ -1074,7 +1077,7 @@ 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 ${LIBUSB_CFLAGS})
|
||||
if (HAVE_LIBUSB_H)
|
||||
@@ -1088,7 +1091,7 @@ 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)
|
||||
if(HIDAPI_ONLY_LIBUSB)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
|
||||
@@ -1160,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