summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2021-07-16 03:02:00 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2021-07-16 21:43:02 +0200
commitd3748cad73f5a4bc11e6cd0ad178a8828676e45e (patch)
tree1c5dd1275315a12f2c49129bb8db4ceb75cee8f1 /CMakeLists.txt
parentMerge pull request #6579 from ameerj/float-settings (diff)
downloadyuzu-d3748cad73f5a4bc11e6cd0ad178a8828676e45e.tar
yuzu-d3748cad73f5a4bc11e6cd0ad178a8828676e45e.tar.gz
yuzu-d3748cad73f5a4bc11e6cd0ad178a8828676e45e.tar.bz2
yuzu-d3748cad73f5a4bc11e6cd0ad178a8828676e45e.tar.lz
yuzu-d3748cad73f5a4bc11e6cd0ad178a8828676e45e.tar.xz
yuzu-d3748cad73f5a4bc11e6cd0ad178a8828676e45e.tar.zst
yuzu-d3748cad73f5a4bc11e6cd0ad178a8828676e45e.zip
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 12 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 716256cd5..214d5a4a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ project(yuzu)
option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF)
# On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
-option(YUZU_ALLOW_SYSTEM_SDL2 "Try using system SDL2 before fallling back to one from externals" OFF)
+CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
option(ENABLE_QT "Enable the Qt frontend" ON)
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
@@ -387,26 +387,20 @@ if (ENABLE_SDL2)
add_library(SDL2 INTERFACE)
target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
+ elseif (YUZU_USE_EXTERNAL_SDL2)
+ message(STATUS "Using SDL2 from externals.")
else()
- if (YUZU_ALLOW_SYSTEM_SDL2)
- find_package(SDL2 2.0.15 QUIET)
-
- if (SDL2_FOUND)
- # Some installations don't set SDL2_LIBRARIES
- if("${SDL2_LIBRARIES}" STREQUAL "")
- message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
- set(SDL2_LIBRARIES "SDL2::SDL2")
- endif()
+ find_package(SDL2 2.0.15 REQUIRED)
- include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
- add_library(SDL2 INTERFACE)
- target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}")
- else()
- message(STATUS "SDL2 2.0.15 or newer not found, falling back to externals.")
- endif()
- else()
- message(STATUS "Using SDL2 from externals.")
+ # Some installations don't set SDL2_LIBRARIES
+ if("${SDL2_LIBRARIES}" STREQUAL "")
+ message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
+ set(SDL2_LIBRARIES "SDL2::SDL2")
endif()
+
+ include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
+ add_library(SDL2 INTERFACE)
+ target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}")
endif()
endif()