summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-12-06 15:58:48 +0100
committerGitHub <noreply@github.com>2022-12-06 15:58:48 +0100
commita225ba4cda6a5e38af6cd7464d19754506152ec9 (patch)
tree3506ce99ec9730d6ae08e593c0c7a4979d9e8ce2 /CMakeLists.txt
parentMerge pull request #9387 from abouvier/cmake-libusb (diff)
parentcmake: use sdl2 imported target (diff)
downloadyuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar
yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar.gz
yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar.bz2
yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar.lz
yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar.xz
yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar.zst
yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.zip
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 3 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2bdee819..cd59e7485 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -432,23 +432,13 @@ if (ENABLE_SDL2)
set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library")
set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll")
- add_library(SDL2 INTERFACE)
- target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
- target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
+ add_library(SDL2::SDL2 INTERFACE IMPORTED)
+ target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}")
+ target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
elseif (YUZU_USE_EXTERNAL_SDL2)
message(STATUS "Using SDL2 from externals.")
else()
find_package(SDL2 2.0.18 REQUIRED)
-
- # 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()