summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
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
39option(YUZU_TESTS "Compile tests" ON) 39option(YUZU_TESTS "Compile tests" ON)
40 40
41option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" OFF) 41option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
42 42
43if (YUZU_USE_BUNDLED_VCPKG) 43if (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)
45elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "") 49elseif(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
162find_package(fmt 8.0.1 REQUIRED CONFIG) 166find_package(fmt 8.0.1 REQUIRED CONFIG)
163find_package(lz4 1.8 REQUIRED)
164find_package(nlohmann_json 3.8 REQUIRED CONFIG) 167find_package(nlohmann_json 3.8 REQUIRED CONFIG)
165find_package(ZLIB 1.2 REQUIRED) 168find_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)
171endif() 174endif()
172 175
176# lz4 1.8 is required, but vcpkg's lz4-config.cmake does not have version info
177find_package(lz4 CONFIG)
178if (NOT lz4_FOUND)
179 find_package(lz4 1.8 REQUIRED)
180endif()
181
173if (YUZU_TESTS) 182if (YUZU_TESTS)
174 find_package(Catch2 2.13.7 REQUIRED CONFIG) 183 find_package(Catch2 2.13.7 REQUIRED CONFIG)
175endif() 184endif()
@@ -355,16 +364,10 @@ if (ENABLE_SDL2)
355 endif() 364 endif()
356endif() 365endif()
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
363if (TARGET Boost::Boost) 370if (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)
367elseif (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)
370endif() 373endif()