diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d35ccb696..5f508d61a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -38,9 +38,13 @@ option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON) | |||
| 38 | 38 | ||
| 39 | option(YUZU_TESTS "Compile tests" ON) | 39 | option(YUZU_TESTS "Compile tests" ON) |
| 40 | 40 | ||
| 41 | option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" OFF) | 41 | option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}") |
| 42 | 42 | ||
| 43 | if (YUZU_USE_BUNDLED_VCPKG) | 43 | if (YUZU_USE_BUNDLED_VCPKG) |
| 44 | if (YUZU_TESTS) | ||
| 45 | list(APPEND VCPKG_MANIFEST_FEATURES "yuzu-tests") | ||
| 46 | endif() | ||
| 47 | |||
| 44 | include(${CMAKE_SOURCE_DIR}/externals/vcpkg/scripts/buildsystems/vcpkg.cmake) | 48 | include(${CMAKE_SOURCE_DIR}/externals/vcpkg/scripts/buildsystems/vcpkg.cmake) |
| 45 | elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "") | 49 | elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "") |
| 46 | # Disable manifest mode (use vcpkg classic mode) when using a custom vcpkg installation | 50 | # Disable manifest mode (use vcpkg classic mode) when using a custom vcpkg installation |
| @@ -160,7 +164,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | |||
| 160 | # ======================================================================= | 164 | # ======================================================================= |
| 161 | 165 | ||
| 162 | find_package(fmt 8.0.1 REQUIRED CONFIG) | 166 | find_package(fmt 8.0.1 REQUIRED CONFIG) |
| 163 | find_package(lz4 1.8 REQUIRED) | ||
| 164 | find_package(nlohmann_json 3.8 REQUIRED CONFIG) | 167 | find_package(nlohmann_json 3.8 REQUIRED CONFIG) |
| 165 | find_package(ZLIB 1.2 REQUIRED) | 168 | find_package(ZLIB 1.2 REQUIRED) |
| 166 | 169 | ||
| @@ -170,6 +173,12 @@ if (NOT zstd_FOUND) | |||
| 170 | find_package(zstd 1.5 REQUIRED) | 173 | find_package(zstd 1.5 REQUIRED) |
| 171 | endif() | 174 | endif() |
| 172 | 175 | ||
| 176 | # lz4 1.8 is required, but vcpkg's lz4-config.cmake does not have version info | ||
| 177 | find_package(lz4 CONFIG) | ||
| 178 | if (NOT lz4_FOUND) | ||
| 179 | find_package(lz4 1.8 REQUIRED) | ||
| 180 | endif() | ||
| 181 | |||
| 173 | if (YUZU_TESTS) | 182 | if (YUZU_TESTS) |
| 174 | find_package(Catch2 2.13.7 REQUIRED CONFIG) | 183 | find_package(Catch2 2.13.7 REQUIRED CONFIG) |
| 175 | endif() | 184 | endif() |
| @@ -355,16 +364,10 @@ if (ENABLE_SDL2) | |||
| 355 | endif() | 364 | endif() |
| 356 | endif() | 365 | endif() |
| 357 | 366 | ||
| 358 | # TODO(lat9nq): Determine what if any of this we still need | 367 | # Reexport some targets that are named differently when using the upstream CmakeConfig |
| 359 | # | ||
| 360 | # Reexport some targets that are named differently when using the upstream CmakeConfig vs the generated Conan config | ||
| 361 | # In order to ALIAS targets to a new name, they first need to be IMPORTED_GLOBAL | 368 | # In order to ALIAS targets to a new name, they first need to be IMPORTED_GLOBAL |
| 362 | # Dynarmic checks for target `boost` and so we want to make sure it can find it through our system instead of using their external | 369 | # Dynarmic checks for target `boost` and so we want to make sure it can find it through our system instead of using their external |
| 363 | if (TARGET Boost::Boost) | 370 | if (TARGET Boost::boost) |
| 364 | set_target_properties(Boost::Boost PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 365 | add_library(Boost::boost ALIAS Boost::Boost) | ||
| 366 | add_library(boost ALIAS Boost::Boost) | ||
| 367 | elseif (TARGET Boost::boost) | ||
| 368 | set_target_properties(Boost::boost PROPERTIES IMPORTED_GLOBAL TRUE) | 371 | set_target_properties(Boost::boost PROPERTIES IMPORTED_GLOBAL TRUE) |
| 369 | add_library(boost ALIAS Boost::boost) | 372 | add_library(boost ALIAS Boost::boost) |
| 370 | endif() | 373 | endif() |