Преглед на файлове

ci,CMake: Integrate vcpkg into CMakeLists

Uses manifest mode if the bundled vcpkg is used.
lat9nq преди 4 години
родител
ревизия
265d1d6979
променени са 8 файла, в които са добавени 45 реда и са изтрити 7 реда
  1. 0 1
      .ci/scripts/clang/docker.sh
  2. 0 1
      .ci/scripts/linux/docker.sh
  3. 1 3
      .ci/templates/build-msvc.yml
  4. 1 2
      .github/workflows/verify.yml
  5. 3 0
      .gitmodules
  6. 10 0
      CMakeLists.txt
  7. 1 0
      externals/vcpkg
  8. 29 0
      vcpkg.json

+ 0 - 1
.ci/scripts/clang/docker.sh

@@ -11,7 +11,6 @@ cmake .. \
       -DCMAKE_CXX_COMPILER=/usr/lib/ccache/clang++ \
       -DCMAKE_C_COMPILER=/usr/lib/ccache/clang \
       -DCMAKE_INSTALL_PREFIX="/usr" \
-      -DCMAKE_TOOLCHAIN_FILE=${VCPKG_TOOLCHAIN_FILE} \
       -DDISPLAY_VERSION=$1 \
       -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
       -DENABLE_QT_TRANSLATION=ON \

+ 0 - 1
.ci/scripts/linux/docker.sh

@@ -12,7 +12,6 @@ cmake .. \
       -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
       -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
       -DCMAKE_INSTALL_PREFIX="/usr" \
-      -DCMAKE_TOOLCHAIN_FILE=${VCPKG_TOOLCHAIN_FILE} \
       -DDISPLAY_VERSION=$1 \
       -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
       -DENABLE_QT_TRANSLATION=ON \

+ 1 - 3
.ci/templates/build-msvc.yml

@@ -6,9 +6,7 @@ parameters:
 steps:
 - script: choco install vulkan-sdk
   displayName: 'Install vulkan-sdk'
-- script: python -m pip install --upgrade pip conan
-  displayName: 'Install conan'
-- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 17 2022" -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 ..
+- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 17 2022" -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 ..
   displayName: 'Configure CMake'
 - task: MSBuild@1
   displayName: 'Build'

+ 1 - 2
.github/workflows/verify.yml

@@ -80,7 +80,6 @@ jobs:
         shell: cmd
         run: |
           choco install vulkan-sdk wget
-          python -m pip install --upgrade pip conan
           call refreshenv
           wget https://github.com/mbitsnbites/buildcache/releases/download/v0.27.6/buildcache-windows.zip
           7z x buildcache-windows.zip
@@ -100,7 +99,7 @@ jobs:
         run: |
           glslangValidator --version
           mkdir build
-          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
+          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 -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON
       - name: Build
         run: cmake --build build
       - name: Cache Summary

+ 3 - 0
.gitmodules

@@ -40,3 +40,6 @@
 [submodule "externals/ffmpeg/ffmpeg"]
 	path = externals/ffmpeg/ffmpeg
 	url = https://git.ffmpeg.org/ffmpeg.git
+[submodule "externals/vcpkg"]
+	path = externals/vcpkg
+	url = https://github.com/Microsoft/vcpkg.git

+ 10 - 0
CMakeLists.txt

@@ -35,6 +35,16 @@ option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON)
 
 option(YUZU_TESTS "Compile tests" ON)
 
+option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" OFF)
+
+if (YUZU_USE_BUNDLED_VCPKG)
+    include(${CMAKE_SOURCE_DIR}/externals/vcpkg/scripts/buildsystems/vcpkg.cmake)
+elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "")
+    # Disable manifest mode (use vcpkg classic mode) when using a custom vcpkg installation
+    option(VCPKG_MANIFEST_MODE "")
+    include("$ENV{VCPKG_TOOLCHAIN_FILE}")
+endif()
+
 # Default to a Release build
 get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
 if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)

+ 1 - 0
externals/vcpkg

@@ -0,0 +1 @@
+Subproject commit cef0b3ec767df6e83806899fe9525f6cf8d7bc91

+ 29 - 0
vcpkg.json

@@ -0,0 +1,29 @@
+{
+    "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
+    "name": "yuzu",
+    "version": "1.0",
+    "dependencies": [
+        "boost-algorithm",
+        "boost-asio",
+        "boost-bind",
+        "boost-config",
+        "boost-container",
+        "boost-context",
+        "boost-crc",
+        "boost-functional",
+        "boost-icl",
+        "boost-intrusive",
+        "boost-mpl",
+        "boost-process",
+        "boost-range",
+        "boost-spirit",
+        "boost-test",
+        "boost-timer",
+        "boost-variant",
+        "fmt",
+        "lz4",
+        "nlohmann-json",
+        "zlib",
+        "zstd"
+    ]
+}