diff options
Diffstat (limited to 'externals')
| -rw-r--r-- | externals/CMakeLists.txt | 45 | ||||
| -rw-r--r-- | externals/find-modules/FindDiscordRPC.cmake | 27 | ||||
| -rw-r--r-- | externals/find-modules/Findenet.cmake | 17 | ||||
| -rw-r--r-- | externals/find-modules/Findhttplib.cmake | 22 | ||||
| -rw-r--r-- | externals/find-modules/Findinih.cmake | 17 | ||||
| -rw-r--r-- | externals/find-modules/Findlz4.cmake | 37 | ||||
| -rw-r--r-- | externals/find-modules/Findzstd.cmake | 37 | ||||
| -rw-r--r-- | externals/inih/CMakeLists.txt | 3 |
8 files changed, 163 insertions, 42 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index eb6cb706d..fea10d809 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) |
| @@ -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() | ||
diff --git a/externals/find-modules/FindDiscordRPC.cmake b/externals/find-modules/FindDiscordRPC.cmake new file mode 100644 index 000000000..44ca9904f --- /dev/null +++ b/externals/find-modules/FindDiscordRPC.cmake | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 4 | |||
| 5 | find_path(DiscordRPC_INCLUDE_DIR discord_rpc.h) | ||
| 6 | |||
| 7 | find_library(DiscordRPC_LIBRARY discord-rpc) | ||
| 8 | |||
| 9 | include(FindPackageHandleStandardArgs) | ||
| 10 | find_package_handle_standard_args(DiscordRPC | ||
| 11 | REQUIRED_VARS | ||
| 12 | DiscordRPC_LIBRARY | ||
| 13 | DiscordRPC_INCLUDE_DIR | ||
| 14 | ) | ||
| 15 | |||
| 16 | if (DiscordRPC_FOUND AND NOT TARGET DiscordRPC::discord-rpc) | ||
| 17 | add_library(DiscordRPC::discord-rpc UNKNOWN IMPORTED) | ||
| 18 | set_target_properties(DiscordRPC::discord-rpc PROPERTIES | ||
| 19 | IMPORTED_LOCATION "${DiscordRPC_LIBRARY}" | ||
| 20 | INTERFACE_INCLUDE_DIRECTORIES "${DiscordRPC_INCLUDE_DIR}" | ||
| 21 | ) | ||
| 22 | endif() | ||
| 23 | |||
| 24 | mark_as_advanced( | ||
| 25 | DiscordRPC_INCLUDE_DIR | ||
| 26 | DiscordRPC_LIBRARY | ||
| 27 | ) | ||
diff --git a/externals/find-modules/Findenet.cmake b/externals/find-modules/Findenet.cmake new file mode 100644 index 000000000..663a2592f --- /dev/null +++ b/externals/find-modules/Findenet.cmake | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 4 | |||
| 5 | find_package(PkgConfig QUIET) | ||
| 6 | if (PKG_CONFIG_FOUND) | ||
| 7 | pkg_search_module(ENET QUIET IMPORTED_TARGET GLOBAL libenet) | ||
| 8 | if (ENET_FOUND) | ||
| 9 | add_library(enet::enet ALIAS PkgConfig::ENET) | ||
| 10 | endif() | ||
| 11 | endif() | ||
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(enet | ||
| 15 | REQUIRED_VARS ENET_LINK_LIBRARIES | ||
| 16 | VERSION_VAR ENET_VERSION | ||
| 17 | ) | ||
diff --git a/externals/find-modules/Findhttplib.cmake b/externals/find-modules/Findhttplib.cmake new file mode 100644 index 000000000..56e92a637 --- /dev/null +++ b/externals/find-modules/Findhttplib.cmake | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-2.0-or-later | ||
| 4 | |||
| 5 | include(FindPackageHandleStandardArgs) | ||
| 6 | |||
| 7 | find_package(httplib QUIET CONFIG) | ||
| 8 | if (httplib_FOUND) | ||
| 9 | find_package_handle_standard_args(httplib CONFIG_MODE) | ||
| 10 | else() | ||
| 11 | find_package(PkgConfig QUIET) | ||
| 12 | if (PKG_CONFIG_FOUND) | ||
| 13 | pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET GLOBAL cpp-httplib) | ||
| 14 | if (HTTPLIB_FOUND) | ||
| 15 | add_library(httplib::httplib ALIAS PkgConfig::HTTPLIB) | ||
| 16 | endif() | ||
| 17 | endif() | ||
| 18 | find_package_handle_standard_args(httplib | ||
| 19 | REQUIRED_VARS HTTPLIB_INCLUDEDIR | ||
| 20 | VERSION_VAR HTTPLIB_VERSION | ||
| 21 | ) | ||
| 22 | endif() | ||
diff --git a/externals/find-modules/Findinih.cmake b/externals/find-modules/Findinih.cmake new file mode 100644 index 000000000..844396471 --- /dev/null +++ b/externals/find-modules/Findinih.cmake | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 4 | |||
| 5 | find_package(PkgConfig QUIET) | ||
| 6 | if (PKG_CONFIG_FOUND) | ||
| 7 | pkg_search_module(INIREADER QUIET IMPORTED_TARGET GLOBAL INIReader) | ||
| 8 | if (INIREADER_FOUND) | ||
| 9 | add_library(inih::INIReader ALIAS PkgConfig::INIREADER) | ||
| 10 | endif() | ||
| 11 | endif() | ||
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(inih | ||
| 15 | REQUIRED_VARS INIREADER_LINK_LIBRARIES | ||
| 16 | VERSION_VAR INIREADER_VERSION | ||
| 17 | ) | ||
diff --git a/externals/find-modules/Findlz4.cmake b/externals/find-modules/Findlz4.cmake index 13ca5de66..a928c4307 100644 --- a/externals/find-modules/Findlz4.cmake +++ b/externals/find-modules/Findlz4.cmake | |||
| @@ -1,19 +1,30 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 yuzu Emulator Project | 1 | # SPDX-FileCopyrightText: 2022 yuzu Emulator Project |
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | find_package(PkgConfig) | 4 | include(FindPackageHandleStandardArgs) |
| 5 | 5 | ||
| 6 | if (PKG_CONFIG_FOUND) | 6 | find_package(lz4 QUIET CONFIG) |
| 7 | pkg_search_module(liblz4 IMPORTED_TARGET GLOBAL liblz4) | 7 | if (lz4_FOUND) |
| 8 | if (liblz4_FOUND) | 8 | find_package_handle_standard_args(lz4 CONFIG_MODE) |
| 9 | add_library(lz4::lz4 ALIAS PkgConfig::liblz4) | 9 | if (NOT TARGET lz4::lz4) |
| 10 | if (TARGET LZ4::lz4_shared) | ||
| 11 | set_target_properties(LZ4::lz4_shared PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 12 | add_library(lz4::lz4 ALIAS LZ4::lz4_shared) | ||
| 13 | else() | ||
| 14 | set_target_properties(LZ4::lz4_static PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 15 | add_library(lz4::lz4 ALIAS LZ4::lz4_static) | ||
| 16 | endif() | ||
| 17 | endif() | ||
| 18 | else() | ||
| 19 | find_package(PkgConfig QUIET) | ||
| 20 | if (PKG_CONFIG_FOUND) | ||
| 21 | pkg_search_module(liblz4 QUIET IMPORTED_TARGET GLOBAL liblz4) | ||
| 22 | if (liblz4_FOUND) | ||
| 23 | add_library(lz4::lz4 ALIAS PkgConfig::liblz4) | ||
| 24 | endif() | ||
| 10 | endif() | 25 | endif() |
| 26 | find_package_handle_standard_args(lz4 | ||
| 27 | REQUIRED_VARS liblz4_LINK_LIBRARIES | ||
| 28 | VERSION_VAR liblz4_VERSION | ||
| 29 | ) | ||
| 11 | endif() | 30 | endif() |
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(lz4 | ||
| 15 | REQUIRED_VARS | ||
| 16 | liblz4_LINK_LIBRARIES | ||
| 17 | liblz4_FOUND | ||
| 18 | VERSION_VAR liblz4_VERSION | ||
| 19 | ) | ||
diff --git a/externals/find-modules/Findzstd.cmake b/externals/find-modules/Findzstd.cmake index f4031eb70..1c29f3598 100644 --- a/externals/find-modules/Findzstd.cmake +++ b/externals/find-modules/Findzstd.cmake | |||
| @@ -1,19 +1,30 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 yuzu Emulator Project | 1 | # SPDX-FileCopyrightText: 2022 yuzu Emulator Project |
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | find_package(PkgConfig) | 4 | include(FindPackageHandleStandardArgs) |
| 5 | 5 | ||
| 6 | if (PKG_CONFIG_FOUND) | 6 | find_package(zstd QUIET CONFIG) |
| 7 | pkg_search_module(libzstd IMPORTED_TARGET GLOBAL libzstd) | 7 | if (zstd_FOUND) |
| 8 | if (libzstd_FOUND) | 8 | find_package_handle_standard_args(zstd CONFIG_MODE) |
| 9 | add_library(zstd::zstd ALIAS PkgConfig::libzstd) | 9 | if (NOT TARGET zstd::zstd) |
| 10 | if (TARGET zstd::libzstd_shared) | ||
| 11 | set_target_properties(zstd::libzstd_shared PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 12 | add_library(zstd::zstd ALIAS zstd::libzstd_shared) | ||
| 13 | else() | ||
| 14 | set_target_properties(zstd::libzstd_static PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 15 | add_library(zstd::zstd ALIAS zstd::libzstd_static) | ||
| 16 | endif() | ||
| 17 | endif() | ||
| 18 | else() | ||
| 19 | find_package(PkgConfig QUIET) | ||
| 20 | if (PKG_CONFIG_FOUND) | ||
| 21 | pkg_search_module(libzstd QUIET IMPORTED_TARGET GLOBAL libzstd) | ||
| 22 | if (libzstd_FOUND) | ||
| 23 | add_library(zstd::zstd ALIAS PkgConfig::libzstd) | ||
| 24 | endif() | ||
| 10 | endif() | 25 | endif() |
| 26 | find_package_handle_standard_args(zstd | ||
| 27 | REQUIRED_VARS libzstd_LINK_LIBRARIES | ||
| 28 | VERSION_VAR libzstd_VERSION | ||
| 29 | ) | ||
| 11 | endif() | 30 | endif() |
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(zstd | ||
| 15 | REQUIRED_VARS | ||
| 16 | libzstd_LINK_LIBRARIES | ||
| 17 | libzstd_FOUND | ||
| 18 | VERSION_VAR libzstd_VERSION | ||
| 19 | ) | ||
diff --git a/externals/inih/CMakeLists.txt b/externals/inih/CMakeLists.txt index b686e3cf5..ebb60a976 100644 --- a/externals/inih/CMakeLists.txt +++ b/externals/inih/CMakeLists.txt | |||
| @@ -9,4 +9,5 @@ add_library(inih | |||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | create_target_directory_groups(inih) | 11 | create_target_directory_groups(inih) |
| 12 | target_include_directories(inih INTERFACE .) | 12 | target_include_directories(inih INTERFACE inih/cpp) |
| 13 | add_library(inih::INIReader ALIAS inih) | ||