From a6f4de32e67defd72be65ed16e275ec2b3fb2bfc Mon Sep 17 00:00:00 2001 From: Sergio Ricardo Zerbetto Masson Date: Tue, 14 Jul 2026 15:50:42 -0300 Subject: [PATCH] Update Windows CI and samples to Visual Studio 2026 The CI Windows runners no longer provide Visual Studio 2022, so the "Visual Studio 17 2022" CMake generator fails to configure. Move the Windows build to Visual Studio 2026: - windows.yml: use the "Visual Studio 18 2026" generator (requires CMake >= 4.2) and bump jwlawson/actions-setup-cmake to v2.2.0. - ci.yml: pin the Windows CMake version to 4.2.7. - Set CMAKE_POLICY_VERSION_MINIMUM=3.5 for the Windows job: CMake 4.x removed compatibility with cmake_minimum_required(VERSION < 3.5), and the vendored RapidJSON source (downloaded at configure time) still declares an older minimum. Also bump the RapidJSON download driver's own minimum to 3.5. - Build the samples as C++17: the VS 2026 MSVC toolset removed , which the samples fell back to under C++14; they now use std::filesystem. The GLTFSDK library itself still targets C++14. Validated locally with VS 2026 + CMake 4.2.7 for x64 and Win32 (RelWithDebInfo and Debug); all 345 unit tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 039828de-4db2-48f8-a5de-c9f7d33baffa --- .github/workflows/ci.yml | 2 +- .github/workflows/windows.yml | 9 +++++++-- External/RapidJSON/CMakeRapidJSONDownload.txt.in | 2 +- GLTFSDK.Samples/CMakeLists.txt | 7 +++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 352b934..5a95d91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: build-windows: uses: ./.github/workflows/windows.yml with: - cmake-version: '3.31.0' + cmake-version: '4.2.7' platforms: "['x64', 'Win32', 'ARM64']" configurations: "['RelWithDebInfo', 'Debug']" # MacOS diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c7c84ea..e48b9f4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,6 +16,11 @@ on: jobs: build: runs-on: windows-latest + env: + # CMake 4.x removed compatibility with cmake_minimum_required(VERSION < 3.5). + # The vendored RapidJSON source (downloaded at configure time) still declares an + # older minimum, so clamp the policy version for its nested/child configures. + CMAKE_POLICY_VERSION_MINIMUM: "3.5" strategy: matrix: platform: ${{ fromJson(inputs.platforms) }} @@ -26,11 +31,11 @@ jobs: with: submodules: 'true' - name: Setup CMake - uses: jwlawson/actions-setup-cmake@v2.0.2 + uses: jwlawson/actions-setup-cmake@v2.2.0 with: cmake-version: ${{ inputs.cmake-version }} - name: CMake Configure - run: cmake -G "Visual Studio 17 2022" -A ${{ matrix.platform }} -B ./Built/Int/cmake_${{ matrix.platform }} . + run: cmake -G "Visual Studio 18 2026" -A ${{ matrix.platform }} -B ./Built/Int/cmake_${{ matrix.platform }} . - name: CMake Build run: cmake --build . --target install --config ${{ matrix.config }} working-directory: ./Built/Int/cmake_${{ matrix.platform }} diff --git a/External/RapidJSON/CMakeRapidJSONDownload.txt.in b/External/RapidJSON/CMakeRapidJSONDownload.txt.in index ed9135e..9e3be43 100644 --- a/External/RapidJSON/CMakeRapidJSONDownload.txt.in +++ b/External/RapidJSON/CMakeRapidJSONDownload.txt.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.2) +cmake_minimum_required(VERSION 3.5) project(RapidJSON-download NONE) diff --git a/GLTFSDK.Samples/CMakeLists.txt b/GLTFSDK.Samples/CMakeLists.txt index a66ed93..b8062b1 100644 --- a/GLTFSDK.Samples/CMakeLists.txt +++ b/GLTFSDK.Samples/CMakeLists.txt @@ -1,4 +1,11 @@ cmake_minimum_required(VERSION 3.5) +# Visual Studio 2026 (MSVC 14.5x) removed the header that +# these samples fall back to under C++14. Build the samples as C++17 so they use the +# standard header instead (see each sample's Source/main.cpp). The GLTFSDK +# library itself continues to target C++14. +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + add_subdirectory(Deserialize) add_subdirectory(Serialize)