summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar lat9nq2022-07-25 13:02:09 -0400
committerGravatar lat9nq2022-07-28 16:01:47 -0400
commitdfc6dd0a2d4ccb84767987d1f316ce57c19ff62d (patch)
treeeadbf859946e21504fd3493ec804d4f8f53e2201 /CMakeLists.txt
parentMerge pull request #8349 from yuzu-emu/revert-8256-ci-vs-2022 (diff)
downloadyuzu-dfc6dd0a2d4ccb84767987d1f316ce57c19ff62d.tar.gz
yuzu-dfc6dd0a2d4ccb84767987d1f316ce57c19ff62d.tar.xz
yuzu-dfc6dd0a2d4ccb84767987d1f316ce57c19ff62d.zip
cmake,ci: vcpkg for MSVC default, fix lz4 include, catch2, cleanup
vcpkg: Add Catch2 2.13.9 Catch2 >= 3.0 is not compatible with earlier versions, and for now we must override the desired version in our vcpkg manifest. We can do this programmatically by using VCPKG_MANIFEST_FEATURES. CMakeLists: Search for lz4 CONFIG mode first vcpkg's lz4 CONFIG cmake script works in Release mode but not in Debug mode, failing to copy the correct DLLs at compile time. We still need to search for the regular mode for system-installed versions. CMakeLists: Clean up boost exports Remove some Conan-specific workarounds. CMakeLists: Use vcpkg for MSVC by default Not enabling it generally since it's much easier to have system dependencies installed for Linux and MinGW.
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()