diff options
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 6 | ||||
| -rw-r--r-- | CMakeModules/FindLLVM.cmake | 18 | ||||
| -rw-r--r-- | CMakeModules/Findhttplib.cmake | 12 | ||||
| -rw-r--r-- | CMakeModules/Findinih.cmake | 19 |
4 files changed, 43 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f344ffd9..7a7faa1c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -212,8 +212,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | |||
| 212 | # Enforce the search mode of non-required packages for better and shorter failure messages | 212 | # Enforce the search mode of non-required packages for better and shorter failure messages |
| 213 | find_package(enet 1.3 MODULE) | 213 | find_package(enet 1.3 MODULE) |
| 214 | find_package(fmt 9 REQUIRED) | 214 | find_package(fmt 9 REQUIRED) |
| 215 | find_package(inih MODULE) | 215 | find_package(inih 52 MODULE COMPONENTS INIReader) |
| 216 | find_package(LLVM MODULE) | 216 | find_package(LLVM MODULE COMPONENTS Demangle) |
| 217 | find_package(lz4 REQUIRED) | 217 | find_package(lz4 REQUIRED) |
| 218 | find_package(nlohmann_json 3.8 REQUIRED) | 218 | find_package(nlohmann_json 3.8 REQUIRED) |
| 219 | find_package(Opus 1.3 MODULE) | 219 | find_package(Opus 1.3 MODULE) |
| @@ -246,7 +246,7 @@ endif() | |||
| 246 | 246 | ||
| 247 | if (ENABLE_WEB_SERVICE) | 247 | if (ENABLE_WEB_SERVICE) |
| 248 | find_package(cpp-jwt 1.4 CONFIG) | 248 | find_package(cpp-jwt 1.4 CONFIG) |
| 249 | find_package(httplib 0.12 MODULE) | 249 | find_package(httplib 0.12 MODULE COMPONENTS OpenSSL) |
| 250 | endif() | 250 | endif() |
| 251 | 251 | ||
| 252 | if (YUZU_TESTS) | 252 | if (YUZU_TESTS) |
diff --git a/CMakeModules/FindLLVM.cmake b/CMakeModules/FindLLVM.cmake index 513d9a536..efbd0ca46 100644 --- a/CMakeModules/FindLLVM.cmake +++ b/CMakeModules/FindLLVM.cmake | |||
| @@ -2,15 +2,25 @@ | |||
| 2 | # | 2 | # |
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | 3 | # SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | 4 | ||
| 5 | find_package(LLVM QUIET CONFIG) | 5 | find_package(LLVM QUIET COMPONENTS CONFIG) |
| 6 | if (LLVM_FOUND) | ||
| 7 | separate_arguments(LLVM_DEFINITIONS) | ||
| 8 | if (LLVMDemangle IN_LIST LLVM_AVAILABLE_LIBS) | ||
| 9 | set(LLVM_Demangle_FOUND TRUE) | ||
| 10 | endif() | ||
| 11 | endif() | ||
| 6 | 12 | ||
| 7 | include(FindPackageHandleStandardArgs) | 13 | include(FindPackageHandleStandardArgs) |
| 8 | find_package_handle_standard_args(LLVM CONFIG_MODE) | 14 | find_package_handle_standard_args(LLVM HANDLE_COMPONENTS CONFIG_MODE) |
| 9 | 15 | ||
| 10 | if (LLVM_FOUND AND NOT TARGET LLVM::Demangle) | 16 | if (LLVM_FOUND AND LLVM_Demangle_FOUND AND NOT TARGET LLVM::Demangle) |
| 11 | add_library(LLVM::Demangle INTERFACE IMPORTED) | 17 | add_library(LLVM::Demangle INTERFACE IMPORTED) |
| 12 | llvm_map_components_to_libnames(LLVM_LIBRARIES demangle) | ||
| 13 | target_compile_definitions(LLVM::Demangle INTERFACE ${LLVM_DEFINITIONS}) | 18 | target_compile_definitions(LLVM::Demangle INTERFACE ${LLVM_DEFINITIONS}) |
| 14 | target_include_directories(LLVM::Demangle INTERFACE ${LLVM_INCLUDE_DIRS}) | 19 | target_include_directories(LLVM::Demangle INTERFACE ${LLVM_INCLUDE_DIRS}) |
| 20 | # prefer shared LLVM: https://github.com/llvm/llvm-project/issues/34593 | ||
| 21 | # but use ugly hack because llvm_config doesn't support interface library | ||
| 22 | add_library(_dummy_lib SHARED EXCLUDE_FROM_ALL src/yuzu/main.cpp) | ||
| 23 | llvm_config(_dummy_lib USE_SHARED demangle) | ||
| 24 | get_target_property(LLVM_LIBRARIES _dummy_lib LINK_LIBRARIES) | ||
| 15 | target_link_libraries(LLVM::Demangle INTERFACE ${LLVM_LIBRARIES}) | 25 | target_link_libraries(LLVM::Demangle INTERFACE ${LLVM_LIBRARIES}) |
| 16 | endif() | 26 | endif() |
diff --git a/CMakeModules/Findhttplib.cmake b/CMakeModules/Findhttplib.cmake index 861207eb5..48967add9 100644 --- a/CMakeModules/Findhttplib.cmake +++ b/CMakeModules/Findhttplib.cmake | |||
| @@ -6,13 +6,23 @@ include(FindPackageHandleStandardArgs) | |||
| 6 | 6 | ||
| 7 | find_package(httplib QUIET CONFIG) | 7 | find_package(httplib QUIET CONFIG) |
| 8 | if (httplib_CONSIDERED_CONFIGS) | 8 | if (httplib_CONSIDERED_CONFIGS) |
| 9 | find_package_handle_standard_args(httplib CONFIG_MODE) | 9 | find_package_handle_standard_args(httplib HANDLE_COMPONENTS CONFIG_MODE) |
| 10 | else() | 10 | else() |
| 11 | find_package(PkgConfig QUIET) | 11 | find_package(PkgConfig QUIET) |
| 12 | pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib) | 12 | pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib) |
| 13 | if ("-DCPPHTTPLIB_OPENSSL_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER) | ||
| 14 | set(httplib_OpenSSL_FOUND TRUE) | ||
| 15 | endif() | ||
| 16 | if ("-DCPPHTTPLIB_ZLIB_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER) | ||
| 17 | set(httplib_ZLIB_FOUND TRUE) | ||
| 18 | endif() | ||
| 19 | if ("-DCPPHTTPLIB_BROTLI_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER) | ||
| 20 | set(httplib_Brotli_FOUND TRUE) | ||
| 21 | endif() | ||
| 13 | find_package_handle_standard_args(httplib | 22 | find_package_handle_standard_args(httplib |
| 14 | REQUIRED_VARS HTTPLIB_INCLUDEDIR | 23 | REQUIRED_VARS HTTPLIB_INCLUDEDIR |
| 15 | VERSION_VAR HTTPLIB_VERSION | 24 | VERSION_VAR HTTPLIB_VERSION |
| 25 | HANDLE_COMPONENTS | ||
| 16 | ) | 26 | ) |
| 17 | endif() | 27 | endif() |
| 18 | 28 | ||
diff --git a/CMakeModules/Findinih.cmake b/CMakeModules/Findinih.cmake index b8d38dcff..791befebd 100644 --- a/CMakeModules/Findinih.cmake +++ b/CMakeModules/Findinih.cmake | |||
| @@ -3,14 +3,25 @@ | |||
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | 3 | # SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | 4 | ||
| 5 | find_package(PkgConfig QUIET) | 5 | find_package(PkgConfig QUIET) |
| 6 | pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader) | 6 | pkg_search_module(INIH QUIET IMPORTED_TARGET inih) |
| 7 | if (INIReader IN_LIST inih_FIND_COMPONENTS) | ||
| 8 | pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader) | ||
| 9 | if (INIREADER_FOUND) | ||
| 10 | set(inih_INIReader_FOUND TRUE) | ||
| 11 | endif() | ||
| 12 | endif() | ||
| 7 | 13 | ||
| 8 | include(FindPackageHandleStandardArgs) | 14 | include(FindPackageHandleStandardArgs) |
| 9 | find_package_handle_standard_args(inih | 15 | find_package_handle_standard_args(inih |
| 10 | REQUIRED_VARS INIREADER_LINK_LIBRARIES | 16 | REQUIRED_VARS INIH_LINK_LIBRARIES |
| 11 | VERSION_VAR INIREADER_VERSION | 17 | VERSION_VAR INIH_VERSION |
| 18 | HANDLE_COMPONENTS | ||
| 12 | ) | 19 | ) |
| 13 | 20 | ||
| 14 | if (inih_FOUND AND NOT TARGET inih::INIReader) | 21 | if (inih_FOUND AND NOT TARGET inih::inih) |
| 22 | add_library(inih::inih ALIAS PkgConfig::INIH) | ||
| 23 | endif() | ||
| 24 | |||
| 25 | if (inih_FOUND AND inih_INIReader_FOUND AND NOT TARGET inih::INIReader) | ||
| 15 | add_library(inih::INIReader ALIAS PkgConfig::INIREADER) | 26 | add_library(inih::INIReader ALIAS PkgConfig::INIREADER) |
| 16 | endif() | 27 | endif() |