diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-02-06 20:59:56 -0800 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-02-06 20:59:58 -0800 |
| commit | fc0d88817f60521886da4ec59d77e7026b44d406 (patch) | |
| tree | 7c631d5e5993def69c924db6694035c6468a8ead /Source/Core/InputCommon | |
| parent | bdf09c7d3bc5a22b562ce0f51400090b13ea8879 (diff) | |
CMake: make option ENABLE_SDL work again
Broken in PR #4755 / commit f978765
Diffstat (limited to 'Source/Core/InputCommon')
| -rw-r--r-- | Source/Core/InputCommon/CMakeLists.txt | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 8a41d101e9..bc56dbe4f7 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -51,27 +51,29 @@ if(UNIX) set(SRCS ${SRCS} ControllerInterface/Pipes/Pipes.cpp) endif() -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) +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}) + set(SRCS ${SRCS} ControllerInterface/SDL/SDL.cpp) + set(LIBS ${LIBS} ${SDL_TARGET}) + add_definitions(-DHAVE_SDL=1) + else() + message(STATUS "SDL NOT found, disabling SDL input") endif() -endif() -if(SDL_TARGET AND TARGET ${SDL_TARGET}) - set(SRCS ${SRCS} ControllerInterface/SDL/SDL.cpp) - set(LIBS ${LIBS} ${SDL_TARGET}) - add_definitions(-DHAVE_SDL=1) -else() - message(STATUS "SDL NOT found, disabling SDL input") endif() add_dolphin_library(inputcommon "${SRCS}" "${LIBS}") |
