summaryrefslogtreecommitdiffstats
path: root/externals/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandre Bouvier <contact@amb.tf>2022-11-25 19:35:46 +0100
committerAlexandre Bouvier <contact@amb.tf>2022-12-04 17:09:25 +0100
commit8e17b5469fc7f5211fc3e24841896ea030adce84 (patch)
treec5baf2ed91c115c7f07063297d2cd611e73b6713 /externals/CMakeLists.txt
parentMerge pull request #9375 from jbeich/xbyak-no-install (diff)
downloadyuzu-8e17b5469fc7f5211fc3e24841896ea030adce84.tar
yuzu-8e17b5469fc7f5211fc3e24841896ea030adce84.tar.gz
yuzu-8e17b5469fc7f5211fc3e24841896ea030adce84.tar.bz2
yuzu-8e17b5469fc7f5211fc3e24841896ea030adce84.tar.lz
yuzu-8e17b5469fc7f5211fc3e24841896ea030adce84.tar.xz
yuzu-8e17b5469fc7f5211fc3e24841896ea030adce84.tar.zst
yuzu-8e17b5469fc7f5211fc3e24841896ea030adce84.zip
Diffstat (limited to 'externals/CMakeLists.txt')
-rw-r--r--externals/CMakeLists.txt45
1 files changed, 30 insertions, 15 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index d25626ccc..8bb321e35 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -6,15 +6,16 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/externals/find-modules")
include(DownloadExternals)
# xbyak
-if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)
+if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak)
add_subdirectory(xbyak EXCLUDE_FROM_ALL)
endif()
# Dynarmic
-if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
+if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmic)
set(DYNARMIC_NO_BUNDLED_FMT ON)
set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE)
- add_subdirectory(dynarmic)
+ add_subdirectory(dynarmic EXCLUDE_FROM_ALL)
+ add_library(dynarmic::dynarmic ALIAS dynarmic)
endif()
# getopt
@@ -26,7 +27,9 @@ endif()
add_subdirectory(glad)
# inih
-add_subdirectory(inih)
+if (NOT TARGET inih::INIReader)
+ add_subdirectory(inih)
+endif()
# mbedtls
add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
@@ -73,25 +76,30 @@ if (YUZU_USE_EXTERNAL_SDL2)
endif()
# ENet
-add_subdirectory(enet)
-target_include_directories(enet INTERFACE ./enet/include)
+if (NOT TARGET enet::enet)
+ add_subdirectory(enet EXCLUDE_FROM_ALL)
+ target_include_directories(enet INTERFACE ./enet/include)
+ add_library(enet::enet ALIAS enet)
+endif()
# Cubeb
-if(ENABLE_CUBEB)
+if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb)
set(BUILD_TESTS OFF CACHE BOOL "")
add_subdirectory(cubeb EXCLUDE_FROM_ALL)
+ add_library(cubeb::cubeb ALIAS cubeb)
endif()
# DiscordRPC
-if (USE_DISCORD_PRESENCE)
+if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc)
add_subdirectory(discord-rpc EXCLUDE_FROM_ALL)
target_include_directories(discord-rpc INTERFACE ./discord-rpc/include)
+ add_library(DiscordRPC::discord-rpc ALIAS discord-rpc)
endif()
# Sirit
-add_subdirectory(sirit)
+add_subdirectory(sirit EXCLUDE_FROM_ALL)
-if (ENABLE_WEB_SERVICE)
+if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib)
if (NOT WIN32)
find_package(OpenSSL 1.1)
if (OPENSSL_FOUND)
@@ -119,18 +127,20 @@ if (ENABLE_WEB_SERVICE)
if (WIN32)
target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32)
endif()
-
- # cpp-jwt
+ add_library(httplib::httplib ALIAS httplib)
+endif()
+
+# cpp-jwt
+if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt)
add_library(cpp-jwt INTERFACE)
target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include)
target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON)
+ add_library(cpp-jwt::cpp-jwt ALIAS cpp-jwt)
endif()
# Opus
-if (YUZU_USE_BUNDLED_OPUS)
+if (NOT TARGET Opus::opus)
add_subdirectory(opus EXCLUDE_FROM_ALL)
-else()
- find_package(Opus 1.3 REQUIRED)
endif()
# FFMpeg
@@ -141,3 +151,8 @@ if (YUZU_USE_BUNDLED_FFMPEG)
set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" PARENT_SCOPE)
set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE)
endif()
+
+# Vulkan-Headers
+if (NOT TARGET Vulkan::Headers)
+ add_subdirectory(Vulkan-Headers EXCLUDE_FROM_ALL)
+endif()