diff options
| -rw-r--r-- | .ci/templates/build-msvc.yml | 2 | ||||
| -rw-r--r-- | .github/workflows/verify.yml | 2 | ||||
| -rw-r--r-- | CMakeLists.txt | 23 | ||||
| -rw-r--r-- | vcpkg.json | 13 |
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: | |||
| 9 | steps: | 9 | steps: |
| 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 | ||
| 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() |
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 | } |