diff options
| author | Jun Bo Bi <jambonmcyeah@gmail.com> | 2021-08-06 15:22:18 -0400 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2022-07-10 15:38:59 -0700 |
| commit | ceed42a0eeb396c30c2bf8451b5da69fabff5da9 (patch) | |
| tree | e53a2d1d26bdd1d43899278b265b88b0bd4942f9 /Source/Core/InputCommon | |
| parent | 6cb936d0cf1a57fa461f097473b5b0b5ccaf09a1 (diff) | |
Add SDL as a submodule
Diffstat (limited to 'Source/Core/InputCommon')
| -rw-r--r-- | Source/Core/InputCommon/CMakeLists.txt | 32 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/ControllerInterface.h | 3 |
2 files changed, 9 insertions, 26 deletions
diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 06f959a91a..9cca78b65d 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -174,32 +174,12 @@ if(UNIX) ) endif() -if(ENABLE_SDL) - find_package(SDL2) - if(SDL2_FOUND) - message(STATUS "Using shared SDL2") - set(SDL_TARGET SDL2::SDL2) - else() - # SDL2 not found, try SDL - find_package(SDL) - if(SDL_FOUND) - message(STATUS "Using shared SDL") - add_library(System_SDL INTERFACE) - target_include_directories(System_SDL INTERFACE ${SDL_INCLUDE_DIR}) - target_link_libraries(System_SDL INTERFACE ${SDL_LIBRARY}) - set(SDL_TARGET System_SDL) - endif() - endif() - if(SDL_TARGET AND TARGET ${SDL_TARGET}) - target_sources(inputcommon PRIVATE - ControllerInterface/SDL/SDL.cpp - ControllerInterface/SDL/SDL.h - ) - target_link_libraries(inputcommon PRIVATE ${SDL_TARGET}) - target_compile_definitions(inputcommon PRIVATE "CIFACE_USE_SDL=1") - else() - message(STATUS "SDL NOT found, disabling SDL input") - endif() +if(SDL2_FOUND) + target_sources(inputcommon PRIVATE + ControllerInterface/SDL/SDL.cpp + ControllerInterface/SDL/SDL.h + ) + target_link_libraries(inputcommon PRIVATE SDL2::SDL2) endif() if(MSVC) diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h index 7a5ee0ad26..2f43cacc42 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h @@ -30,6 +30,9 @@ #define CIFACE_USE_PIPES #endif #define CIFACE_USE_DUALSHOCKUDPCLIENT +#if defined(HAVE_SDL2) +#define CIFACE_USE_SDL +#endif namespace ciface { |
