summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2022-07-30 07:27:52 -0400
committerGravatar GitHub2022-07-30 07:27:52 -0400
commit69e04da5373b0ea5b71aed2d70c7aa76dd2be1b8 (patch)
tree6a4e09afc723e338d45163bd4d40950ceb170e6f
parentMerge pull request #8664 from liamwhite/monkey-compiler-v12-1 (diff)
parentcmake,ci: vcpkg for MSVC default, fix lz4 include, catch2, cleanup (diff)
downloadyuzu-69e04da5373b0ea5b71aed2d70c7aa76dd2be1b8.tar.gz
yuzu-69e04da5373b0ea5b71aed2d70c7aa76dd2be1b8.tar.xz
yuzu-69e04da5373b0ea5b71aed2d70c7aa76dd2be1b8.zip
Merge pull request #8640 from lat9nq/vcpkg-extra
cmake,ci: vcpkg leftovers
-rw-r--r--.ci/templates/build-msvc.yml2
-rw-r--r--.github/workflows/verify.yml2
-rw-r--r--CMakeLists.txt23
-rw-r--r--vcpkg.json13
4 files changed, 28 insertions, 12 deletions
diff --git a/.ci/templates/build-msvc.yml b/.ci/templates/build-msvc.yml
index dfb5862c3..2a1bf93bc 100644
--- a/.ci/templates/build-msvc.yml
+++ b/.ci/templates/build-msvc.yml
@@ -9,7 +9,7 @@ parameters:
9steps: 9steps:
10- script: choco install vulkan-sdk 10- script: choco install vulkan-sdk
11 displayName: 'Install vulkan-sdk' 11 displayName: 'Install vulkan-sdk'
12- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 16 2019" -A x64 -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON .. && cd .. 12- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 16 2019" -A x64 -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release .. && cd ..
13 displayName: 'Configure CMake' 13 displayName: 'Configure CMake'
14- task: MSBuild@1 14- task: MSBuild@1
15 displayName: 'Build' 15 displayName: 'Build'
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index 18cefe325..b753f1764 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -104,7 +104,7 @@ jobs:
104 run: | 104 run: |
105 glslangValidator --version 105 glslangValidator --version
106 mkdir build 106 mkdir build
107 cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DGIT_BRANCH=pr-verify -DCLANG_FORMAT_SUFFIX=discordplzdontclang -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON 107 cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DGIT_BRANCH=pr-verify -DCLANG_FORMAT_SUFFIX=discordplzdontclang
108 - name: Build 108 - name: Build
109 run: cmake --build build 109 run: cmake --build build
110 - name: Cache Summary 110 - name: Cache Summary
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()
diff --git a/vcpkg.json b/vcpkg.json
index 8d3c5919a..b247f7386 100644
--- a/vcpkg.json
+++ b/vcpkg.json
@@ -1,6 +1,7 @@
1{ 1{
2 "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", 2 "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3 "name": "yuzu", 3 "name": "yuzu",
4 "builtin-baseline": "cef0b3ec767df6e83806899fe9525f6cf8d7bc91",
4 "version": "1.0", 5 "version": "1.0",
5 "dependencies": [ 6 "dependencies": [
6 "boost-algorithm", 7 "boost-algorithm",
@@ -25,5 +26,17 @@
25 "nlohmann-json", 26 "nlohmann-json",
26 "zlib", 27 "zlib",
27 "zstd" 28 "zstd"
29 ],
30 "features": {
31 "yuzu-tests": {
32 "description": "Compile tests",
33 "dependencies": [ "catch2" ]
34 }
35 },
36 "overrides": [
37 {
38 "name": "catch2",
39 "version": "2.13.9"
40 }
28 ] 41 ]
29} 42}