summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-11-30 01:41:47 +0100
committerGitHub <noreply@github.com>2022-11-30 01:41:47 +0100
commit49219b8a864f0176a52486e5a33cc443f91e8f97 (patch)
tree1b655d4b25ff251d75ebbd829f3541999616e4cc
parentMerge pull request #9308 from lat9nq/from-scratch (diff)
parentCMake: Directly link to SDL2-static when appropriate (diff)
downloadyuzu-49219b8a864f0176a52486e5a33cc443f91e8f97.tar
yuzu-49219b8a864f0176a52486e5a33cc443f91e8f97.tar.gz
yuzu-49219b8a864f0176a52486e5a33cc443f91e8f97.tar.bz2
yuzu-49219b8a864f0176a52486e5a33cc443f91e8f97.tar.lz
yuzu-49219b8a864f0176a52486e5a33cc443f91e8f97.tar.xz
yuzu-49219b8a864f0176a52486e5a33cc443f91e8f97.tar.zst
yuzu-49219b8a864f0176a52486e5a33cc443f91e8f97.zip
-rw-r--r--CMakeLists.txt2
-rw-r--r--externals/CMakeLists.txt1
-rw-r--r--src/audio_core/CMakeLists.txt6
-rw-r--r--src/input_common/CMakeLists.txt6
-rw-r--r--src/yuzu/CMakeLists.txt6
5 files changed, 16 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2d2761ec1..05bffe68e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
-cmake_minimum_required(VERSION 3.15)
+cmake_minimum_required(VERSION 3.22)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index d807ef65f..9740e017c 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -69,7 +69,6 @@ if (YUZU_USE_EXTERNAL_SDL2)
set(SDL_SHARED OFF)
add_subdirectory(SDL EXCLUDE_FROM_ALL)
- add_library(SDL2 ALIAS SDL2-static)
endif()
# ENet
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt
index 8e3a8f5a8..75416c53a 100644
--- a/src/audio_core/CMakeLists.txt
+++ b/src/audio_core/CMakeLists.txt
@@ -226,6 +226,10 @@ if(ENABLE_CUBEB)
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
endif()
if(ENABLE_SDL2)
- target_link_libraries(audio_core PRIVATE SDL2)
+ if (YUZU_USE_EXTERNAL_SDL2)
+ target_link_libraries(audio_core PRIVATE SDL2-static)
+ else()
+ target_link_libraries(audio_core PRIVATE SDL2)
+ endif()
target_compile_definitions(audio_core PRIVATE HAVE_SDL2)
endif()
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt
index cc6f0ffc0..193127d0a 100644
--- a/src/input_common/CMakeLists.txt
+++ b/src/input_common/CMakeLists.txt
@@ -55,7 +55,11 @@ if (ENABLE_SDL2)
drivers/sdl_driver.cpp
drivers/sdl_driver.h
)
- target_link_libraries(input_common PRIVATE SDL2)
+ if (YUZU_USE_EXTERNAL_SDL2)
+ target_link_libraries(input_common PRIVATE SDL2-static)
+ else()
+ target_link_libraries(input_common PRIVATE SDL2)
+ endif()
target_compile_definitions(input_common PRIVATE HAVE_SDL2)
endif()
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt
index 0aa109dd3..060de0259 100644
--- a/src/yuzu/CMakeLists.txt
+++ b/src/yuzu/CMakeLists.txt
@@ -387,7 +387,11 @@ if (YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_LESS 6)
endif()
if (ENABLE_SDL2)
- target_link_libraries(yuzu PRIVATE SDL2)
+ if (YUZU_USE_EXTERNAL_SDL2)
+ target_link_libraries(yuzu PRIVATE SDL2-static)
+ else()
+ target_link_libraries(yuzu PRIVATE SDL2)
+ endif()
target_compile_definitions(yuzu PRIVATE HAVE_SDL2)
endif()