mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 08:12:44 +01:00
On Linux, build SDL2 from externals with HIDAPI support
This commit is contained in:
parent
f2b76284ed
commit
648bef235e
2 changed files with 18 additions and 11 deletions
|
@ -12,6 +12,8 @@ project(yuzu)
|
|||
# OFF by default, but if ENABLE_SDL2 and MSVC are true then ON
|
||||
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
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_ALLOW_SYSTEM_SDL2 "Try using system SDL2 before fallling back to one from externals" NOT UNIX "ENABLE_SDL2" OFF)
|
||||
|
||||
option(ENABLE_QT "Enable the Qt frontend" ON)
|
||||
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
|
||||
|
@ -292,6 +294,7 @@ if (ENABLE_SDL2)
|
|||
target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
|
||||
target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
|
||||
else()
|
||||
if (YUZU_ALLOW_SYSTEM_SDL2)
|
||||
find_package(SDL2 2.0.15 QUIET)
|
||||
|
||||
if (SDL2_FOUND)
|
||||
|
@ -307,6 +310,9 @@ if (ENABLE_SDL2)
|
|||
else()
|
||||
message(STATUS "SDL2 2.0.15 or newer not found, falling back to externals.")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using SDL2 from externals.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
1
externals/CMakeLists.txt
vendored
1
externals/CMakeLists.txt
vendored
|
@ -49,6 +49,7 @@ target_include_directories(unicorn-headers INTERFACE ./unicorn/include)
|
|||
if (NOT SDL2_FOUND AND ENABLE_SDL2)
|
||||
set(SDL_STATIC ON)
|
||||
set(SDL_SHARED OFF)
|
||||
set(OPT_DEF_HIDAPI ON)
|
||||
add_subdirectory(SDL EXCLUDE_FROM_ALL)
|
||||
add_library(SDL2 ALIAS SDL2-static)
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue