diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9ecf1bb..2e9ba24 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -24,14 +24,23 @@ jobs: - name: Install Dependencies run: bash ./scripts/debian-11/1-install-deps.sh - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11 + - name: Restore vcpkg + id: cache-vcpkg-restore + uses: actions/cache/restore@v3 with: - runVcpkgInstall: true + path: ./vcpkg/buildtrees + key: ${{ runner.os }}-${{ github.job }}-vcpkg - name: Create Build Environment run: bash ./scripts/debian-11/2-configure.sh '-DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake' + - name: Cache vcpkg + id: cache-vcpkg + uses: actions/cache/save@v3 + with: + path: ./vcpkg/buildtrees + key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} + - name: Build Server run: bash ./scripts/debian-11/3-build.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 15c806e..211b998 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) +if (WIN32) + set(VCPKG_TARGET_TRIPLET x64-windows-static) +endif() + include(cmake/Vcpkg.cmake) # needs to happen before project() project( diff --git a/cmake/Vcpkg.cmake b/cmake/Vcpkg.cmake index 7d95018..9d8ecba 100644 --- a/cmake/Vcpkg.cmake +++ b/cmake/Vcpkg.cmake @@ -1,7 +1,4 @@ if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - if (WIN32) - set(VCPKG_TARGET_TRIPLET x64-windows-static) - endif() if(NOT EXISTS ${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake) find_package(Git) if(Git_FOUND)