Re-apply SDL2 fixes
Goddammit SDL2 - fix your CMake already.
This commit is contained in:
parent
ef7ae860c7
commit
2701c001ad
3 changed files with 5 additions and 2 deletions
3
external/SDL2/CMakeLists.txt
vendored
3
external/SDL2/CMakeLists.txt
vendored
|
@ -266,7 +266,7 @@ add_definitions(-DUSING_GENERATED_CONFIG_H)
|
||||||
# General includes
|
# General includes
|
||||||
include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include)
|
include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include)
|
||||||
if(USE_GCC OR USE_CLANG)
|
if(USE_GCC OR USE_CLANG)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -idirafter ${SDL2_SOURCE_DIR}/src/video/khronos")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -idirafter \"${SDL2_SOURCE_DIR}/src/video/khronos\"")
|
||||||
else()
|
else()
|
||||||
include_directories(${SDL2_SOURCE_DIR}/src/video/khronos)
|
include_directories(${SDL2_SOURCE_DIR}/src/video/khronos)
|
||||||
endif()
|
endif()
|
||||||
|
@ -2092,6 +2092,7 @@ endif()
|
||||||
if(SDL_STATIC)
|
if(SDL_STATIC)
|
||||||
set (BUILD_SHARED_LIBS FALSE)
|
set (BUILD_SHARED_LIBS FALSE)
|
||||||
add_library(SDL2-static STATIC ${SOURCE_FILES})
|
add_library(SDL2-static STATIC ${SOURCE_FILES})
|
||||||
|
target_compile_definitions(SDL2-static PRIVATE SDL_STATIC)
|
||||||
if (NOT SDL_SHARED OR NOT WIN32)
|
if (NOT SDL_SHARED OR NOT WIN32)
|
||||||
set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
|
set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
|
||||||
# Note: Apparently, OUTPUT_NAME must really be unique; even when
|
# Note: Apparently, OUTPUT_NAME must really be unique; even when
|
||||||
|
|
2
external/SDL2/cmake/sdlchecks.cmake
vendored
2
external/SDL2/cmake/sdlchecks.cmake
vendored
|
@ -1088,7 +1088,7 @@ macro(CheckHIDAPI)
|
||||||
set(HAVE_SDL_JOYSTICK TRUE)
|
set(HAVE_SDL_JOYSTICK TRUE)
|
||||||
file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c)
|
file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c)
|
||||||
set(SOURCE_FILES ${SOURCE_FILES} ${HIDAPI_SOURCES})
|
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(NOT HIDAPI_SKIP_LIBUSB)
|
||||||
if(HIDAPI_ONLY_LIBUSB)
|
if(HIDAPI_ONLY_LIBUSB)
|
||||||
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
|
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
|
||||||
|
|
2
external/SDL2/include/begin_code.h
vendored
2
external/SDL2/include/begin_code.h
vendored
|
@ -58,6 +58,8 @@
|
||||||
# else
|
# else
|
||||||
# define DECLSPEC __declspec(dllimport)
|
# define DECLSPEC __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
|
# elif defined(SDL_STATIC)
|
||||||
|
# define DECLSPEC
|
||||||
# else
|
# else
|
||||||
# define DECLSPEC __declspec(dllexport)
|
# define DECLSPEC __declspec(dllexport)
|
||||||
# endif
|
# endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue