diff options
Diffstat (limited to 'externals/CMakeLists.txt')
| -rw-r--r-- | externals/CMakeLists.txt | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index eb6cb706d..4ffafd18c 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -6,15 +6,16 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/externals/find-modules") | |||
| 6 | include(DownloadExternals) | 6 | include(DownloadExternals) |
| 7 | 7 | ||
| 8 | # xbyak | 8 | # xbyak |
| 9 | if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) | 9 | if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) |
| 10 | add_subdirectory(xbyak EXCLUDE_FROM_ALL) | 10 | add_subdirectory(xbyak EXCLUDE_FROM_ALL) |
| 11 | endif() | 11 | endif() |
| 12 | 12 | ||
| 13 | # Dynarmic | 13 | # Dynarmic |
| 14 | if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) | 14 | if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmic) |
| 15 | set(DYNARMIC_NO_BUNDLED_FMT ON) | 15 | set(DYNARMIC_NO_BUNDLED_FMT ON) |
| 16 | set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE) | 16 | set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE) |
| 17 | add_subdirectory(dynarmic) | 17 | add_subdirectory(dynarmic EXCLUDE_FROM_ALL) |
| 18 | add_library(dynarmic::dynarmic ALIAS dynarmic) | ||
| 18 | endif() | 19 | endif() |
| 19 | 20 | ||
| 20 | # getopt | 21 | # getopt |
| @@ -26,7 +27,9 @@ endif() | |||
| 26 | add_subdirectory(glad) | 27 | add_subdirectory(glad) |
| 27 | 28 | ||
| 28 | # inih | 29 | # inih |
| 29 | add_subdirectory(inih) | 30 | if (NOT TARGET inih::INIReader) |
| 31 | add_subdirectory(inih) | ||
| 32 | endif() | ||
| 30 | 33 | ||
| 31 | # mbedtls | 34 | # mbedtls |
| 32 | add_subdirectory(mbedtls EXCLUDE_FROM_ALL) | 35 | add_subdirectory(mbedtls EXCLUDE_FROM_ALL) |
| @@ -42,8 +45,8 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER | |||
| 42 | endif() | 45 | endif() |
| 43 | 46 | ||
| 44 | # libusb | 47 | # libusb |
| 45 | if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB) | 48 | if (NOT TARGET libusb::usb) |
| 46 | add_subdirectory(libusb) | 49 | add_subdirectory(libusb EXCLUDE_FROM_ALL) |
| 47 | endif() | 50 | endif() |
| 48 | 51 | ||
| 49 | # SDL2 | 52 | # SDL2 |
| @@ -72,25 +75,30 @@ if (YUZU_USE_EXTERNAL_SDL2) | |||
| 72 | endif() | 75 | endif() |
| 73 | 76 | ||
| 74 | # ENet | 77 | # ENet |
| 75 | add_subdirectory(enet) | 78 | if (NOT TARGET enet::enet) |
| 76 | target_include_directories(enet INTERFACE ./enet/include) | 79 | add_subdirectory(enet EXCLUDE_FROM_ALL) |
| 80 | target_include_directories(enet INTERFACE ./enet/include) | ||
| 81 | add_library(enet::enet ALIAS enet) | ||
| 82 | endif() | ||
| 77 | 83 | ||
| 78 | # Cubeb | 84 | # Cubeb |
| 79 | if(ENABLE_CUBEB) | 85 | if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb) |
| 80 | set(BUILD_TESTS OFF CACHE BOOL "") | 86 | set(BUILD_TESTS OFF CACHE BOOL "") |
| 81 | add_subdirectory(cubeb EXCLUDE_FROM_ALL) | 87 | add_subdirectory(cubeb EXCLUDE_FROM_ALL) |
| 88 | add_library(cubeb::cubeb ALIAS cubeb) | ||
| 82 | endif() | 89 | endif() |
| 83 | 90 | ||
| 84 | # DiscordRPC | 91 | # DiscordRPC |
| 85 | if (USE_DISCORD_PRESENCE) | 92 | if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc) |
| 86 | add_subdirectory(discord-rpc EXCLUDE_FROM_ALL) | 93 | add_subdirectory(discord-rpc EXCLUDE_FROM_ALL) |
| 87 | target_include_directories(discord-rpc INTERFACE ./discord-rpc/include) | 94 | target_include_directories(discord-rpc INTERFACE ./discord-rpc/include) |
| 95 | add_library(DiscordRPC::discord-rpc ALIAS discord-rpc) | ||
| 88 | endif() | 96 | endif() |
| 89 | 97 | ||
| 90 | # Sirit | 98 | # Sirit |
| 91 | add_subdirectory(sirit) | 99 | add_subdirectory(sirit EXCLUDE_FROM_ALL) |
| 92 | 100 | ||
| 93 | if (ENABLE_WEB_SERVICE) | 101 | if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib) |
| 94 | if (NOT WIN32) | 102 | if (NOT WIN32) |
| 95 | find_package(OpenSSL 1.1) | 103 | find_package(OpenSSL 1.1) |
| 96 | if (OPENSSL_FOUND) | 104 | if (OPENSSL_FOUND) |
| @@ -118,18 +126,20 @@ if (ENABLE_WEB_SERVICE) | |||
| 118 | if (WIN32) | 126 | if (WIN32) |
| 119 | target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32) | 127 | target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32) |
| 120 | endif() | 128 | endif() |
| 121 | 129 | add_library(httplib::httplib ALIAS httplib) | |
| 122 | # cpp-jwt | 130 | endif() |
| 131 | |||
| 132 | # cpp-jwt | ||
| 133 | if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt) | ||
| 123 | add_library(cpp-jwt INTERFACE) | 134 | add_library(cpp-jwt INTERFACE) |
| 124 | target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include) | 135 | target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include) |
| 125 | target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON) | 136 | target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON) |
| 137 | add_library(cpp-jwt::cpp-jwt ALIAS cpp-jwt) | ||
| 126 | endif() | 138 | endif() |
| 127 | 139 | ||
| 128 | # Opus | 140 | # Opus |
| 129 | if (YUZU_USE_BUNDLED_OPUS) | 141 | if (NOT TARGET Opus::opus) |
| 130 | add_subdirectory(opus EXCLUDE_FROM_ALL) | 142 | add_subdirectory(opus EXCLUDE_FROM_ALL) |
| 131 | else() | ||
| 132 | find_package(Opus 1.3 REQUIRED) | ||
| 133 | endif() | 143 | endif() |
| 134 | 144 | ||
| 135 | # FFMpeg | 145 | # FFMpeg |
| @@ -140,3 +150,8 @@ if (YUZU_USE_BUNDLED_FFMPEG) | |||
| 140 | set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" PARENT_SCOPE) | 150 | set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" PARENT_SCOPE) |
| 141 | set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE) | 151 | set(FFmpeg_INCLUDE_DIR "${FFmpeg_INCLUDE_DIR}" PARENT_SCOPE) |
| 142 | endif() | 152 | endif() |
| 153 | |||
| 154 | # Vulkan-Headers | ||
| 155 | if (NOT TARGET Vulkan::Headers) | ||
| 156 | add_subdirectory(Vulkan-Headers EXCLUDE_FROM_ALL) | ||
| 157 | endif() | ||