From 6916e373d5883a55d9ed089e9579e331abd2aab2 Mon Sep 17 00:00:00 2001 From: mirelle7 <115191165+mirelle7@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:14:14 +0200 Subject: [PATCH 1/7] build(cmake): Remove the unused unix preset It pins neither an architecture nor a compiler and no CI job builds it. --- CMakePresets.json | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index a361827a1e2..3a8069a2cdc 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -155,12 +155,6 @@ "RTS_BUILD_OPTION_DEBUG": "ON" } }, - { - "name": "unix", - "inherits": "default-vcpkg", - "hidden": false, - "displayName": "Unix 32bit VCPKG Release" - }, { "name": "mingw-w64-i686", "displayName": "MinGW-w64 32-bit (i686) Release", @@ -266,13 +260,6 @@ "description": "Build Windows 32bit VCPKG Debug", "configuration": "Debug" }, - { - "name": "unix", - "configurePreset": "unix", - "displayName": "Build Unix 32bit VCPKG Release", - "description": "Build Unix 32bit VCPKG Release", - "configuration": "Release" - }, { "name": "mingw-w64-i686", "configurePreset": "mingw-w64-i686", @@ -498,19 +485,6 @@ } ] }, - { - "name": "unix", - "steps": [ - { - "type": "configure", - "name": "unix" - }, - { - "type": "build", - "name": "unix" - } - ] - }, { "name": "mingw-w64-i686", "steps": [ From 662b7b75e9de7513b1b71b6325e51b8292e689d0 Mon Sep 17 00:00:00 2001 From: mirelle7 <115191165+mirelle7@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:24:09 +0200 Subject: [PATCH 2/7] build(cmake): Select vcpkg per build instead of per preset The win32 and win32-vcpkg presets built the same MSVC binary and only differed in where the dependencies come from. Drop the win32-vcpkg presets: the win32 presets fetch dependencies with FetchContent and use vcpkg when its toolchain file is passed. CI selects it with a new vcpkg input on the reusable build workflow and marks those builds +v, keeping the same six MSVC builds per game as before. --- .github/workflows/ci.yml | 26 ++-- .../workflows/reusable-build-toolchain.yml | 31 +++-- CMakePresets.json | 131 ------------------ README.md | 7 + 4 files changed, 44 insertions(+), 151 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8820e216f2a..ed70a4bf094 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,19 +79,22 @@ jobs: - preset: "win32" tools: true extras: true + vcpkg: true - preset: "win32-profile" tools: true extras: true + vcpkg: true - preset: "win32-debug" tools: true extras: true - - preset: "win32-vcpkg" + vcpkg: true + - preset: "win32" tools: true extras: true - - preset: "win32-vcpkg-profile" + - preset: "win32-profile" tools: true extras: true - - preset: "win32-vcpkg-debug" + - preset: "win32-debug" tools: true extras: true fail-fast: false @@ -101,8 +104,9 @@ jobs: preset: ${{ matrix.preset }} tools: ${{ matrix.tools }} extras: ${{ matrix.extras }} + vcpkg: ${{ matrix.vcpkg || false }} tests: ${{ startsWith(matrix.preset, 'win32') }} - benchmarks: ${{ matrix.preset == 'win32' }} + benchmarks: ${{ matrix.preset == 'win32' && !matrix.vcpkg }} secrets: inherit # Note build-generalsmd is split into two jobs for vc6 and win32 because replaycheck-generalsmd @@ -150,20 +154,23 @@ jobs: - preset: "win32" tools: true extras: true + vcpkg: true + ffmpeg: true - preset: "win32-profile" tools: true extras: true + vcpkg: true - preset: "win32-debug" tools: true extras: true - - preset: "win32-vcpkg" + vcpkg: true + - preset: "win32" tools: true extras: true - ffmpeg: true - - preset: "win32-vcpkg-profile" + - preset: "win32-profile" tools: true extras: true - - preset: "win32-vcpkg-debug" + - preset: "win32-debug" tools: true extras: true fail-fast: false @@ -173,9 +180,10 @@ jobs: preset: ${{ matrix.preset }} tools: ${{ matrix.tools }} extras: ${{ matrix.extras }} + vcpkg: ${{ matrix.vcpkg || false }} ffmpeg: ${{ matrix.ffmpeg || false}} tests: true - benchmarks: ${{ matrix.preset == 'win32' }} + benchmarks: ${{ matrix.preset == 'win32' && !matrix.vcpkg }} secrets: inherit replaycheck-generalsmd: diff --git a/.github/workflows/reusable-build-toolchain.yml b/.github/workflows/reusable-build-toolchain.yml index 40edcc2d01d..bff77d9a4ce 100644 --- a/.github/workflows/reusable-build-toolchain.yml +++ b/.github/workflows/reusable-build-toolchain.yml @@ -26,11 +26,16 @@ on: default: false type: boolean description: "Build extras" + vcpkg: + required: false + default: false + type: boolean + description: "Get dependencies from vcpkg instead of FetchContent" ffmpeg: required: false default: false type: boolean - description: "Build with FFmpeg support" + description: "Build with FFmpeg support (requires vcpkg)" tests: required: false default: false @@ -44,7 +49,7 @@ on: jobs: build: - name: ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} + name: ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.vcpkg && '+v' || '' }} runs-on: windows-2022 timeout-minutes: 30 @@ -75,7 +80,7 @@ jobs: uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: build\${{ inputs.preset }}\_deps - key: cmake-deps-${{ inputs.preset }}-${{ hashFiles('CMakePresets.json','cmake/**/*.cmake','**/CMakeLists.txt') }} + key: cmake-deps-${{ inputs.preset }}${{ inputs.vcpkg && '+v' || '' }}-${{ hashFiles('CMakePresets.json','cmake/**/*.cmake','**/CMakeLists.txt') }} - name: Download VC6 Portable from itsmattkc repo if: ${{ startsWith(inputs.preset, 'vc6') && steps.cache-vc6.outputs.cache-hit != 'true' }} @@ -127,14 +132,14 @@ jobs: arch: x86 - name: Setup vcpkg - if: contains(inputs.preset, 'vcpkg') + if: inputs.vcpkg uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6 with: runVcpkgInstall: false doNotCache: true - name: Configure NuGet Source for vcpkg Binary Cache - if: contains(inputs.preset, 'vcpkg') + if: inputs.vcpkg shell: pwsh run: | $nuget = & "$env:VCPKG_ROOT\vcpkg.exe" fetch nuget | Select-Object -Last 1 @@ -148,7 +153,7 @@ jobs: -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" "VCPKG_INSTALL_OPTIONS=--x-abi-tools-use-exact-versions" >> $env:GITHUB_ENV - - name: Configure ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset + - name: Configure ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.vcpkg && '+v' || '' }} Preset shell: pwsh run: | $buildFlags = @( @@ -165,23 +170,27 @@ jobs: $buildFlags += "-DRTS_BUILD_OPTION_TESTS=${{ inputs.tests && 'ON' || 'OFF' }}" $buildFlags += "-DRTS_BUILD_OPTION_BENCHMARKS=${{ inputs.benchmarks && 'ON' || 'OFF' }}" + if ($${{ inputs.vcpkg }}) { + $buildFlags += "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" + } + Write-Host "Build flags: $($buildFlags -join ' | ')" cmake --preset ${{ inputs.preset }} $buildFlags - - name: Build ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset + - name: Build ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.vcpkg && '+v' || '' }} Preset shell: pwsh run: | cmake --build --preset ${{ inputs.preset }} # The benchmarks are only built, because running them takes too long here. # Verbose prints the Google Test output, which lists the test cases of each executable. - - name: Test ${{ inputs.game }} with CTest Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset + - name: Test ${{ inputs.game }} with CTest Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.vcpkg && '+v' || '' }} Preset if: ${{ inputs.tests }} shell: pwsh run: | ctest --preset ${{ inputs.preset }} --verbose - - name: Collect ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact + - name: Collect ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.vcpkg && '+v' || '' }} Artifact shell: pwsh run: | $buildDir = "build\${{ inputs.preset }}" @@ -198,10 +207,10 @@ jobs: $files | Move-Item -Destination $artifactsDir -Verbose -Force - - name: Upload ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact + - name: Upload ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.vcpkg && '+v' || '' }} Artifact uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: - name: ${{ inputs.game }}-${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} + name: ${{ inputs.game }}-${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.vcpkg && '+v' || '' }} path: build\${{ inputs.preset }}\${{ inputs.game }}\artifacts retention-days: 30 if-no-files-found: error diff --git a/CMakePresets.json b/CMakePresets.json index 3a8069a2cdc..855d403beed 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -73,19 +73,6 @@ "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$:Debug>DLL" } }, - { - "name": "default-vcpkg", - "displayName": "Default Config for vcpkg (don't use directly!)", - "generator": "Ninja Multi-Config", - "hidden": true, - "binaryDir": "${sourceDir}/build/${presetName}", - "cacheVariables": { - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", - "CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "$<$:Embedded>", - "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$:Debug>DLL", - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - } - }, { "name": "win32", "inherits": "default", @@ -121,40 +108,6 @@ "RTS_BUILD_OPTION_DEBUG": "ON" } }, - { - "name": "win32-vcpkg", - "inherits": "default-vcpkg", - "hidden": false, - "displayName": "Windows 32bit VCPKG Release", - "architecture": { - "value": "Win32", - "strategy": "external" - }, - "cacheVariables": { - "RTS_FLAGS": "/W3" - }, - "vendor": { - "jetbrains.com/clion": { - "toolchain": "Visual Studio" - } - } - }, - { - "name": "win32-vcpkg-profile", - "inherits": "win32-vcpkg", - "displayName": "Windows 32bit VCPKG Profile", - "cacheVariables": { - "RTS_BUILD_OPTION_PROFILE": "ON" - } - }, - { - "name": "win32-vcpkg-debug", - "inherits": "win32-vcpkg", - "displayName": "Windows 32bit VCPKG Debug", - "cacheVariables": { - "RTS_BUILD_OPTION_DEBUG": "ON" - } - }, { "name": "mingw-w64-i686", "displayName": "MinGW-w64 32-bit (i686) Release", @@ -239,27 +192,6 @@ "description": "Build Windows 32bit Debug", "configuration": "Debug" }, - { - "name": "win32-vcpkg", - "configurePreset": "win32-vcpkg", - "displayName": "Build Windows 32bit VCPKG Release", - "description": "Build Windows 32bit VCPKG Release", - "configuration": "Release" - }, - { - "name": "win32-vcpkg-profile", - "configurePreset": "win32-vcpkg-profile", - "displayName": "Build Windows 32bit VCPKG Profile", - "description": "Build Windows 32bit VCPKG Profile", - "configuration": "Release" - }, - { - "name": "win32-vcpkg-debug", - "configurePreset": "win32-vcpkg-debug", - "displayName": "Build Windows 32bit VCPKG Debug", - "description": "Build Windows 32bit VCPKG Debug", - "configuration": "Debug" - }, { "name": "mingw-w64-i686", "configurePreset": "mingw-w64-i686", @@ -315,30 +247,6 @@ "displayName": "Test Windows 32bit Debug", "description": "Test Windows 32bit Debug", "configuration": "Debug" - }, - { - "name": "win32-vcpkg", - "inherits": "default", - "configurePreset": "win32-vcpkg", - "displayName": "Test Windows 32bit VCPKG Release", - "description": "Test Windows 32bit VCPKG Release", - "configuration": "Release" - }, - { - "name": "win32-vcpkg-profile", - "inherits": "default", - "configurePreset": "win32-vcpkg-profile", - "displayName": "Test Windows 32bit VCPKG Profile", - "description": "Test Windows 32bit VCPKG Profile", - "configuration": "Release" - }, - { - "name": "win32-vcpkg-debug", - "inherits": "default", - "configurePreset": "win32-vcpkg-debug", - "displayName": "Test Windows 32bit VCPKG Debug", - "description": "Test Windows 32bit VCPKG Debug", - "configuration": "Debug" } ], "workflowPresets": [ @@ -446,45 +354,6 @@ } ] }, - { - "name": "win32-vcpkg", - "steps": [ - { - "type": "configure", - "name": "win32-vcpkg" - }, - { - "type": "build", - "name": "win32-vcpkg" - } - ] - }, - { - "name": "win32-vcpkg-profile", - "steps": [ - { - "type": "configure", - "name": "win32-vcpkg-profile" - }, - { - "type": "build", - "name": "win32-vcpkg-profile" - } - ] - }, - { - "name": "win32-vcpkg-debug", - "steps": [ - { - "type": "configure", - "name": "win32-vcpkg-debug" - }, - { - "type": "build", - "name": "win32-vcpkg-debug" - } - ] - }, { "name": "mingw-w64-i686", "steps": [ diff --git a/README.md b/README.md index 5f6e2c54eb2..dbdaa30f4e9 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,13 @@ versions. GitHub Actions consumes these ports through a vcpkg binary cache backe Packages, keyed by vcpkg's own ABI hashes, so the first CI build warms the feed and subsequent builds pull prebuilt binaries instead of re-compiling everything. Pull requests from forks restore from the feed but cannot write to it. +The presets do not require vcpkg. Without it, CMake downloads the dependencies with FetchContent. To use vcpkg, which +FFmpeg support requires, pass its toolchain file when configuring: + +```bash +cmake --preset win32 -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" +``` + ### Profiling Tracy profiling is supported in the CMake preset `win32-profile`. From 4813e5519195468f40b4773b6cbe56da2f93585d Mon Sep 17 00:00:00 2001 From: mirelle7 <115191165+mirelle7@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:33:38 +0200 Subject: [PATCH 3/7] build(cmake): Name presets -- vc6 -> windows-x86-vc6, win32 -> windows-x86-msvc19 and mingw-w64-i686 -> windows-x86-mingwgcc, keeping their -profile, -debug, -releaselog and -weekly suffixes. CI jobs, artifact names, the Docker build and docs follow the new names. --- .github/copilot-instructions.md | 14 +- .github/workflows/build-historical.yml | 14 +- .github/workflows/ci.yml | 48 ++--- .../workflows/reusable-build-toolchain.yml | 10 +- .github/workflows/weekly-release.yml | 8 +- CMakePresets.json | 190 +++++++++--------- README.md | 8 +- TESTING.md | 12 +- resources/dockerbuild/Dockerfile | 4 +- scripts/run-clang-tidy.py | 2 +- 10 files changed, 155 insertions(+), 155 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 9af28e83f51..fbc18d2881d 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -21,21 +21,21 @@ This is the **GeneralsGameCode** project - a community-driven effort to fix and ## Build System ### CMake Presets (Critical) -- **vc6**: Visual Studio 6 compatible build (retail compatibility required) -- **win32**: Modern Visual Studio 2022 build -- **vc6-debug/vc6-profile**: Debug/profiling variants +- **windows-x86-vc6**: Visual Studio 6 compatible build (retail compatibility required) +- **windows-x86-msvc19**: Modern Visual Studio 2022 build +- **windows-x86-vc6-debug/windows-x86-vc6-profile**: Debug/profiling variants - Use `cmake --preset ` followed by `cmake --build build/` ### Build Commands ```bash # Configure with specific preset -cmake --preset vc6 +cmake --preset windows-x86-vc6 # Build (from project root) -cmake --build build/vc6 +cmake --build build/windows-x86-vc6 # Build with tools and extras -cmake --build build/vc6 --target _tools _extras +cmake --build build/windows-x86-vc6 --target _tools _extras ``` ### Retail Compatibility @@ -77,7 +77,7 @@ generalszh.exe -jobs 4 -headless -replay subfolder/*.rep - CI automatically tests GeneralsMD builds against known replays ### Build Validation -- CI tests multiple presets: vc6, vc6-profile, vc6-debug, win32 variants +- CI tests multiple presets: windows-x86-vc6, windows-x86-msvc19 and their variants - Path-based change detection triggers relevant builds - Tools and extras are built with `+t+e` flags diff --git a/.github/workflows/build-historical.yml b/.github/workflows/build-historical.yml index 45be3b62b48..1e8c1311342 100644 --- a/.github/workflows/build-historical.yml +++ b/.github/workflows/build-historical.yml @@ -185,17 +185,17 @@ jobs: "-DRTS_BUILD_CORE_TOOLS=ON", "-DRTS_BUILD_${{ matrix.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}_TOOLS=ON" ) - cmake --preset vc6 $buildFlags + cmake --preset windows-x86-vc6 $buildFlags - name: Build with CMake shell: pwsh run: | - cmake --build --preset vc6 + cmake --build --preset windows-x86-vc6 - name: Collect Artifacts shell: pwsh run: | - $buildDir = "build\vc6" + $buildDir = "build\windows-x86-vc6" $artifactsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ matrix.game }}\artifacts" $files = Get-ChildItem -Path "$buildDir\Core","$buildDir\${{ matrix.game }}" -File | @@ -206,8 +206,8 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: - name: ${{ matrix.game }}-vc6-${{ needs.prepare.outputs.short_sha }} - path: build\vc6\${{ matrix.game }}\artifacts + name: ${{ matrix.game }}-windows-x86-vc6-${{ needs.prepare.outputs.short_sha }} + path: build\windows-x86-vc6\${{ matrix.game }}\artifacts retention-days: 90 create-release: @@ -222,14 +222,14 @@ jobs: if: ${{ github.event.inputs.game == 'Generals' || github.event.inputs.game == 'Both' }} uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: - name: Generals-vc6-${{ needs.prepare.outputs.short_sha }} + name: Generals-windows-x86-vc6-${{ needs.prepare.outputs.short_sha }} path: generals-artifacts - name: Download GeneralsMD Artifact if: ${{ github.event.inputs.game == 'GeneralsMD' || github.event.inputs.game == 'Both' }} uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: - name: GeneralsMD-vc6-${{ needs.prepare.outputs.short_sha }} + name: GeneralsMD-windows-x86-vc6-${{ needs.prepare.outputs.short_sha }} path: generalsmd-artifacts - name: Prepare Release Archives diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed70a4bf094..9e110f24a84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,34 +67,34 @@ jobs: strategy: matrix: include: - - preset: "vc6" + - preset: "windows-x86-vc6" tools: true extras: true - - preset: "vc6-profile" + - preset: "windows-x86-vc6-profile" tools: true extras: true - - preset: "vc6-debug" + - preset: "windows-x86-vc6-debug" tools: true extras: true - - preset: "win32" + - preset: "windows-x86-msvc19" tools: true extras: true vcpkg: true - - preset: "win32-profile" + - preset: "windows-x86-msvc19-profile" tools: true extras: true vcpkg: true - - preset: "win32-debug" + - preset: "windows-x86-msvc19-debug" tools: true extras: true vcpkg: true - - preset: "win32" + - preset: "windows-x86-msvc19" tools: true extras: true - - preset: "win32-profile" + - preset: "windows-x86-msvc19-profile" tools: true extras: true - - preset: "win32-debug" + - preset: "windows-x86-msvc19-debug" tools: true extras: true fail-fast: false @@ -105,8 +105,8 @@ jobs: tools: ${{ matrix.tools }} extras: ${{ matrix.extras }} vcpkg: ${{ matrix.vcpkg || false }} - tests: ${{ startsWith(matrix.preset, 'win32') }} - benchmarks: ${{ matrix.preset == 'win32' && !matrix.vcpkg }} + tests: ${{ startsWith(matrix.preset, 'windows-x86-msvc19') }} + benchmarks: ${{ matrix.preset == 'windows-x86-msvc19' && !matrix.vcpkg }} secrets: inherit # Note build-generalsmd is split into two jobs for vc6 and win32 because replaycheck-generalsmd @@ -120,16 +120,16 @@ jobs: strategy: matrix: include: - - preset: "vc6" + - preset: "windows-x86-vc6" tools: true extras: true - - preset: "vc6-profile" + - preset: "windows-x86-vc6-profile" tools: true extras: true - - preset: "vc6-debug" + - preset: "windows-x86-vc6-debug" tools: true extras: true - - preset: "vc6-releaselog" + - preset: "windows-x86-vc6-releaselog" tools: true extras: true fail-fast: false @@ -151,26 +151,26 @@ jobs: strategy: matrix: include: - - preset: "win32" + - preset: "windows-x86-msvc19" tools: true extras: true vcpkg: true ffmpeg: true - - preset: "win32-profile" + - preset: "windows-x86-msvc19-profile" tools: true extras: true vcpkg: true - - preset: "win32-debug" + - preset: "windows-x86-msvc19-debug" tools: true extras: true vcpkg: true - - preset: "win32" + - preset: "windows-x86-msvc19" tools: true extras: true - - preset: "win32-profile" + - preset: "windows-x86-msvc19-profile" tools: true extras: true - - preset: "win32-debug" + - preset: "windows-x86-msvc19-debug" tools: true extras: true fail-fast: false @@ -183,7 +183,7 @@ jobs: vcpkg: ${{ matrix.vcpkg || false }} ffmpeg: ${{ matrix.ffmpeg || false}} tests: true - benchmarks: ${{ matrix.preset == 'win32' && !matrix.vcpkg }} + benchmarks: ${{ matrix.preset == 'windows-x86-msvc19' && !matrix.vcpkg }} secrets: inherit replaycheck-generalsmd: @@ -195,8 +195,8 @@ jobs: strategy: matrix: include: - - preset: "vc6+t+e" - - preset: "vc6-releaselog+t+e" # optimized build with logging and crashing enabled should be compatible, so we test that here. + - preset: "windows-x86-vc6+t+e" + - preset: "windows-x86-vc6-releaselog+t+e" # optimized build with logging and crashing enabled should be compatible, so we test that here. fail-fast: false uses: ./.github/workflows/reusable-check-replays.yml with: diff --git a/.github/workflows/reusable-build-toolchain.yml b/.github/workflows/reusable-build-toolchain.yml index bff77d9a4ce..2da83988d9a 100644 --- a/.github/workflows/reusable-build-toolchain.yml +++ b/.github/workflows/reusable-build-toolchain.yml @@ -68,7 +68,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Cache VC6 Installation - if: startsWith(inputs.preset, 'vc6') + if: startsWith(inputs.preset, 'windows-x86-vc6') id: cache-vc6 uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: @@ -83,7 +83,7 @@ jobs: key: cmake-deps-${{ inputs.preset }}${{ inputs.vcpkg && '+v' || '' }}-${{ hashFiles('CMakePresets.json','cmake/**/*.cmake','**/CMakeLists.txt') }} - name: Download VC6 Portable from itsmattkc repo - if: ${{ startsWith(inputs.preset, 'vc6') && steps.cache-vc6.outputs.cache-hit != 'true' }} + if: ${{ startsWith(inputs.preset, 'windows-x86-vc6') && steps.cache-vc6.outputs.cache-hit != 'true' }} env: EXPECTED_HASH: "D0EE1F6DCEF7DB3AD703120D9FB4FAD49EBCA28F44372E40550348B1C00CA583" COMMIT: "001c4bafdcf2ef4b474d693acccd35a91e848f40" @@ -107,7 +107,7 @@ jobs: Remove-Item VS6_VisualStudio6.zip -Verbose - name: Set Up VC6 Environment - if: startsWith(inputs.preset, 'vc6') + if: startsWith(inputs.preset, 'windows-x86-vc6') shell: pwsh run: | # Define the base directories as local variables first @@ -126,7 +126,7 @@ jobs: "LIB=$MSVCDir\LIB;$MSVCDir\MFC\LIB;$env:LIB" >> $env:GITHUB_ENV - name: Set Up VC2022 Environment - if: startsWith(inputs.preset, 'win32') + if: startsWith(inputs.preset, 'windows-x86-msvc19') uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: arch: x86 @@ -196,7 +196,7 @@ jobs: $buildDir = "build\${{ inputs.preset }}" $artifactsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ inputs.game }}\artifacts" -Verbose - if ("${{ inputs.preset }}" -like "win32*") { + if ("${{ inputs.preset }}" -like "windows-x86-msvc19*") { $configToUse = if ("${{ inputs.preset }}" -match "debug") { "Debug" } else { "Release" } $files = Get-ChildItem -Path "$buildDir\Core\$configToUse","$buildDir\${{ inputs.game }}\$configToUse" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose diff --git a/.github/workflows/weekly-release.yml b/.github/workflows/weekly-release.yml index 97b0ff34d92..32d9e0ed10d 100644 --- a/.github/workflows/weekly-release.yml +++ b/.github/workflows/weekly-release.yml @@ -92,7 +92,7 @@ jobs: strategy: matrix: include: - - preset: "vc6-weekly" + - preset: "windows-x86-vc6-weekly" tools: true extras: false release: true @@ -113,7 +113,7 @@ jobs: strategy: matrix: include: - - preset: "vc6-weekly" + - preset: "windows-x86-vc6-weekly" tools: true extras: false release: true @@ -161,7 +161,7 @@ jobs: - name: Download Generals VC6 Artifacts uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: - name: Generals-vc6-weekly+t + name: Generals-windows-x86-vc6-weekly+t path: generals-vc6-artifacts - name: Prepare and Zip Generals VC6 @@ -172,7 +172,7 @@ jobs: - name: Download GeneralsMD VC6 Artifacts uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: - name: GeneralsMD-vc6-weekly+t + name: GeneralsMD-windows-x86-vc6-weekly+t path: generalsmd-vc6-artifacts - name: Prepare and Zip GeneralsMD VC6 diff --git a/CMakePresets.json b/CMakePresets.json index 855d403beed..b4304b3b57b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -7,7 +7,7 @@ }, "configurePresets": [ { - "name": "vc6", + "name": "windows-x86-vc6", "displayName": "Windows 32bit VC6 Release", "generator": "Ninja", "hidden": false, @@ -26,37 +26,37 @@ } }, { - "name": "vc6-profile", + "name": "windows-x86-vc6-profile", "displayName": "Windows 32bit VC6 Profile", "hidden": false, - "inherits": "vc6", + "inherits": "windows-x86-vc6", "cacheVariables": { "RTS_BUILD_OPTION_PROFILE": "ON" } }, { - "name": "vc6-debug", + "name": "windows-x86-vc6-debug", "displayName": "Windows 32bit VC6 Debug", "hidden": false, - "inherits": "vc6", + "inherits": "windows-x86-vc6", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", "RTS_BUILD_OPTION_DEBUG": "ON" } }, { - "name": "vc6-releaselog", + "name": "windows-x86-vc6-releaselog", "displayName": "Windows 32bit VC6 Release Logging", - "inherits": "vc6", + "inherits": "windows-x86-vc6", "cacheVariables": { "RTS_DEBUG_LOGGING": "ON", "RTS_DEBUG_CRASHING": "ON" } }, { - "name": "vc6-weekly", + "name": "windows-x86-vc6-weekly", "displayName": "Windows 32bit VC6 Weekly Release", - "inherits": "vc6", + "inherits": "windows-x86-vc6", "cacheVariables": { "RTS_BUILD_OPTION_VC6_FULL_DEBUG": "ON" } @@ -74,10 +74,10 @@ } }, { - "name": "win32", + "name": "windows-x86-msvc19", "inherits": "default", "hidden": false, - "displayName": "Windows 32bit Release", + "displayName": "Windows 32bit MSVC19 Release", "architecture": { "value": "Win32", "strategy": "external" @@ -92,24 +92,24 @@ } }, { - "name": "win32-profile", - "inherits": "win32", - "displayName": "Windows 32bit Profile", + "name": "windows-x86-msvc19-profile", + "inherits": "windows-x86-msvc19", + "displayName": "Windows 32bit MSVC19 Profile", "cacheVariables": { "RTS_BUILD_OPTION_PROFILE": "ON", "RTS_BUILD_OPTION_PROFILE_TRACY": "ON" } }, { - "name": "win32-debug", - "inherits": "win32", - "displayName": "Windows 32bit Debug", + "name": "windows-x86-msvc19-debug", + "inherits": "windows-x86-msvc19", + "displayName": "Windows 32bit MSVC19 Debug", "cacheVariables": { "RTS_BUILD_OPTION_DEBUG": "ON" } }, { - "name": "mingw-w64-i686", + "name": "windows-x86-mingwgcc", "displayName": "MinGW-w64 32-bit (i686) Release", "generator": "Unix Makefiles", "hidden": false, @@ -121,20 +121,20 @@ } }, { - "name": "mingw-w64-i686-debug", + "name": "windows-x86-mingwgcc-debug", "displayName": "MinGW-w64 32-bit (i686) Debug", "hidden": false, - "inherits": "mingw-w64-i686", + "inherits": "windows-x86-mingwgcc", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", "RTS_BUILD_OPTION_DEBUG": "ON" } }, { - "name": "mingw-w64-i686-profile", + "name": "windows-x86-mingwgcc-profile", "displayName": "MinGW-w64 32-bit (i686) Profile", "hidden": false, - "inherits": "mingw-w64-i686", + "inherits": "windows-x86-mingwgcc", "cacheVariables": { "RTS_BUILD_OPTION_PROFILE": "ON" } @@ -142,71 +142,71 @@ ], "buildPresets": [ { - "name": "vc6", - "configurePreset": "vc6", + "name": "windows-x86-vc6", + "configurePreset": "windows-x86-vc6", "displayName": "Build Windows 32bit VC6 Release", "description": "Build Windows 32bit VC6 Release" }, { - "name": "vc6-profile", - "configurePreset": "vc6-profile", + "name": "windows-x86-vc6-profile", + "configurePreset": "windows-x86-vc6-profile", "displayName": "Build Windows 32bit VC6 Profile", "description": "Build Windows 32bit VC6 Profile" }, { - "name": "vc6-debug", - "configurePreset": "vc6-debug", + "name": "windows-x86-vc6-debug", + "configurePreset": "windows-x86-vc6-debug", "displayName": "Build Windows 32bit VC6 Debug", "description": "Build Windows 32bit VC6 Debug" }, { - "name": "vc6-releaselog", - "configurePreset": "vc6-releaselog", + "name": "windows-x86-vc6-releaselog", + "configurePreset": "windows-x86-vc6-releaselog", "displayName": "Build Windows 32bit VC6 Release Logging", "description": "Build Windows 32bit VC6 Release Logging" }, { - "name": "vc6-weekly", - "configurePreset": "vc6-weekly", + "name": "windows-x86-vc6-weekly", + "configurePreset": "windows-x86-vc6-weekly", "displayName": "Build Windows 32bit VC6 Weekly Release", "description": "Build Windows 32bit VC6 Weekly Release" }, { - "name": "win32", - "configurePreset": "win32", - "displayName": "Build Windows 32bit Release", - "description": "Build Windows 32bit Release", + "name": "windows-x86-msvc19", + "configurePreset": "windows-x86-msvc19", + "displayName": "Build Windows 32bit MSVC19 Release", + "description": "Build Windows 32bit MSVC19 Release", "configuration": "Release" }, { - "name": "win32-profile", - "configurePreset": "win32-profile", - "displayName": "Build Windows 32bit Profile", - "description": "Build Windows 32bit Profile", + "name": "windows-x86-msvc19-profile", + "configurePreset": "windows-x86-msvc19-profile", + "displayName": "Build Windows 32bit MSVC19 Profile", + "description": "Build Windows 32bit MSVC19 Profile", "configuration": "Release" }, { - "name": "win32-debug", - "configurePreset": "win32-debug", - "displayName": "Build Windows 32bit Debug", - "description": "Build Windows 32bit Debug", + "name": "windows-x86-msvc19-debug", + "configurePreset": "windows-x86-msvc19-debug", + "displayName": "Build Windows 32bit MSVC19 Debug", + "description": "Build Windows 32bit MSVC19 Debug", "configuration": "Debug" }, { - "name": "mingw-w64-i686", - "configurePreset": "mingw-w64-i686", + "name": "windows-x86-mingwgcc", + "configurePreset": "windows-x86-mingwgcc", "displayName": "Build MinGW-w64 32-bit (i686) Release", "description": "Build MinGW-w64 32-bit (i686) Release" }, { - "name": "mingw-w64-i686-debug", - "configurePreset": "mingw-w64-i686-debug", + "name": "windows-x86-mingwgcc-debug", + "configurePreset": "windows-x86-mingwgcc-debug", "displayName": "Build MinGW-w64 32-bit (i686) Debug", "description": "Build MinGW-w64 32-bit (i686) Debug" }, { - "name": "mingw-w64-i686-profile", - "configurePreset": "mingw-w64-i686-profile", + "name": "windows-x86-mingwgcc-profile", + "configurePreset": "windows-x86-mingwgcc-profile", "displayName": "Build MinGW-w64 32-bit (i686) Profile", "description": "Build MinGW-w64 32-bit (i686) Profile" } @@ -225,171 +225,171 @@ } }, { - "name": "win32", + "name": "windows-x86-msvc19", "inherits": "default", - "configurePreset": "win32", - "displayName": "Test Windows 32bit Release", - "description": "Test Windows 32bit Release", + "configurePreset": "windows-x86-msvc19", + "displayName": "Test Windows 32bit MSVC19 Release", + "description": "Test Windows 32bit MSVC19 Release", "configuration": "Release" }, { - "name": "win32-profile", + "name": "windows-x86-msvc19-profile", "inherits": "default", - "configurePreset": "win32-profile", - "displayName": "Test Windows 32bit Profile", - "description": "Test Windows 32bit Profile", + "configurePreset": "windows-x86-msvc19-profile", + "displayName": "Test Windows 32bit MSVC19 Profile", + "description": "Test Windows 32bit MSVC19 Profile", "configuration": "Release" }, { - "name": "win32-debug", + "name": "windows-x86-msvc19-debug", "inherits": "default", - "configurePreset": "win32-debug", - "displayName": "Test Windows 32bit Debug", - "description": "Test Windows 32bit Debug", + "configurePreset": "windows-x86-msvc19-debug", + "displayName": "Test Windows 32bit MSVC19 Debug", + "description": "Test Windows 32bit MSVC19 Debug", "configuration": "Debug" } ], "workflowPresets": [ { - "name": "vc6", + "name": "windows-x86-vc6", "steps": [ { "type": "configure", - "name": "vc6" + "name": "windows-x86-vc6" }, { "type": "build", - "name": "vc6" + "name": "windows-x86-vc6" } ] }, { - "name": "vc6-debug", + "name": "windows-x86-vc6-debug", "steps": [ { "type": "configure", - "name": "vc6-debug" + "name": "windows-x86-vc6-debug" }, { "type": "build", - "name": "vc6-debug" + "name": "windows-x86-vc6-debug" } ] }, { - "name": "vc6-profile", + "name": "windows-x86-vc6-profile", "steps": [ { "type": "configure", - "name": "vc6-profile" + "name": "windows-x86-vc6-profile" }, { "type": "build", - "name": "vc6-profile" + "name": "windows-x86-vc6-profile" } ] }, { - "name": "vc6-releaselog", + "name": "windows-x86-vc6-releaselog", "steps": [ { "type": "configure", - "name": "vc6-releaselog" + "name": "windows-x86-vc6-releaselog" }, { "type": "build", - "name": "vc6-releaselog" + "name": "windows-x86-vc6-releaselog" } ] }, { - "name": "vc6-weekly", + "name": "windows-x86-vc6-weekly", "steps": [ { "type": "configure", - "name": "vc6-weekly" + "name": "windows-x86-vc6-weekly" }, { "type": "build", - "name": "vc6-weekly" + "name": "windows-x86-vc6-weekly" } ] }, { - "name": "win32", + "name": "windows-x86-msvc19", "steps": [ { "type": "configure", - "name": "win32" + "name": "windows-x86-msvc19" }, { "type": "build", - "name": "win32" + "name": "windows-x86-msvc19" } ] }, { - "name": "win32-profile", + "name": "windows-x86-msvc19-profile", "steps": [ { "type": "configure", - "name": "win32-profile" + "name": "windows-x86-msvc19-profile" }, { "type": "build", - "name": "win32-profile" + "name": "windows-x86-msvc19-profile" } ] }, { - "name": "win32-debug", + "name": "windows-x86-msvc19-debug", "steps": [ { "type": "configure", - "name": "win32-debug" + "name": "windows-x86-msvc19-debug" }, { "type": "build", - "name": "win32-debug" + "name": "windows-x86-msvc19-debug" } ] }, { - "name": "mingw-w64-i686", + "name": "windows-x86-mingwgcc", "steps": [ { "type": "configure", - "name": "mingw-w64-i686" + "name": "windows-x86-mingwgcc" }, { "type": "build", - "name": "mingw-w64-i686" + "name": "windows-x86-mingwgcc" } ] }, { - "name": "mingw-w64-i686-debug", + "name": "windows-x86-mingwgcc-debug", "steps": [ { "type": "configure", - "name": "mingw-w64-i686-debug" + "name": "windows-x86-mingwgcc-debug" }, { "type": "build", - "name": "mingw-w64-i686-debug" + "name": "windows-x86-mingwgcc-debug" } ] }, { - "name": "mingw-w64-i686-profile", + "name": "windows-x86-mingwgcc-profile", "steps": [ { "type": "configure", - "name": "mingw-w64-i686-profile" + "name": "windows-x86-mingwgcc-profile" }, { "type": "build", - "name": "mingw-w64-i686-profile" + "name": "windows-x86-mingwgcc-profile" } ] } diff --git a/README.md b/README.md index dbdaa30f4e9..57c35e61c2b 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ Docker, CLion, and links to forks supporting additional versions. **Windows (Visual Studio 2022)** ```bash -cmake --preset win32 -cmake --build build/win32 --config Release +cmake --preset windows-x86-msvc19 +cmake --build build/windows-x86-msvc19 --config Release ``` **Linux (via Docker)** @@ -91,12 +91,12 @@ The presets do not require vcpkg. Without it, CMake downloads the dependencies w FFmpeg support requires, pass its toolchain file when configuring: ```bash -cmake --preset win32 -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" +cmake --preset windows-x86-msvc19 -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" ``` ### Profiling -Tracy profiling is supported in the CMake preset `win32-profile`. +Tracy profiling is supported in the CMake preset `windows-x86-msvc19-profile`. Use `tracy-profiler.exe` from [Tracy v0.13.1](https://github.com/wolfpld/tracy/releases/tag/v0.13.1). If you get an error when using Tracy, try removing `dbghelp.dll` from the game binary directory. diff --git a/TESTING.md b/TESTING.md index bb58d2591c2..af0f79729c8 100644 --- a/TESTING.md +++ b/TESTING.md @@ -17,9 +17,9 @@ It will run the game in the background and check that each replay is compatible. Unit tests use [Google Test](https://github.com/TheSuperHackers/google-test). They need a C++17 compiler, so they are not available with VC6. Enable them with `RTS_BUILD_OPTION_TESTS` and run them with CTest: ``` -cmake --preset win32 -DRTS_BUILD_OPTION_TESTS=ON -cmake --build --preset win32 -ctest --preset win32 +cmake --preset windows-x86-msvc19 -DRTS_BUILD_OPTION_TESTS=ON +cmake --build --preset windows-x86-msvc19 +ctest --preset windows-x86-msvc19 ``` Visual Studio also lists the tests in its Test Explorer. A test executable can be run directly as well, for example with `--gtest_filter=AsciiString.*` or with `--gtest_break_on_failure` to stop in the debugger. @@ -50,8 +50,8 @@ The `BM_INIScan` benchmarks compare the production numeric scanners with the ori For example, from an x86 developer shell: ``` -cmake --preset win32 -DRTS_BUILD_OPTION_BENCHMARKS=ON -cmake --build --preset win32 --target z_googlebenchmark g_googlebenchmark -build/win32/Benchmarks/Google/Release/z_googlebenchmark.exe --benchmark_filter=^BM_INIScan --benchmark_min_time=0.2s --benchmark_repetitions=5 --benchmark_enable_random_interleaving=true --benchmark_out=ini-benchmark.json --benchmark_out_format=json +cmake --preset windows-x86-msvc19 -DRTS_BUILD_OPTION_BENCHMARKS=ON +cmake --build --preset windows-x86-msvc19 --target z_googlebenchmark g_googlebenchmark +build/windows-x86-msvc19/Benchmarks/Google/Release/z_googlebenchmark.exe --benchmark_filter=^BM_INIScan --benchmark_min_time=0.2s --benchmark_repetitions=5 --benchmark_enable_random_interleaving=true --benchmark_out=ini-benchmark.json --benchmark_out_format=json ``` Use the median CPU time for each case when comparing repeated runs. The same filter also works with `g_googlebenchmark.exe`. Relative output paths are resolved from the executable's directory; use an absolute `--benchmark_out` path to save elsewhere. diff --git a/resources/dockerbuild/Dockerfile b/resources/dockerbuild/Dockerfile index 0b2626d5cb3..8731a1aeedd 100644 --- a/resources/dockerbuild/Dockerfile +++ b/resources/dockerbuild/Dockerfile @@ -72,14 +72,14 @@ $VS\\vc98\\lib;\ $VS\\vc98\\include;\ $VS\\common\\Tools;\ $VS\\common\\MSDev98\\bin" -ENV LIB="$VS\\vc98\\Lib;$VS\\vc98\\MFC\\Lib;Z:\\build\\cnc\\build\\vc6" +ENV LIB="$VS\\vc98\\Lib;$VS\\vc98\\MFC\\Lib;Z:\\build\\cnc\\build\\windows-x86-vc6" ENV INCLUDE="$VS\\vc98\\ATL\\INCLUDE;\ $VS\\vc98\\INCLUDE;\ $VS\\vc98\\MFC\\INCLUDE;\ $VS\\vc98\\Include" ENV CC="$VS\\vc98\\bin\\CL.exe" ENV CXX="$VS\\vc98\\bin\\CL.exe" -ENV PRESET=vc6 +ENV PRESET=windows-x86-vc6 #prevent cache warning ENV HOME=/build/tmp/home diff --git a/scripts/run-clang-tidy.py b/scripts/run-clang-tidy.py index 71b41ab70ce..6f436a0918c 100755 --- a/scripts/run-clang-tidy.py +++ b/scripts/run-clang-tidy.py @@ -412,7 +412,7 @@ def main(): python scripts/run-clang-tidy.py --verbose --include Core/Libraries/ # Use different build directory - python scripts/run-clang-tidy.py --build-dir build/win32-debug + python scripts/run-clang-tidy.py --build-dir build/windows-x86-msvc19-debug Note: Requires a PCH-free build. Create with: cmake -B build/clang-tidy -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja From 4ee5bee07d3fdde660f78192095ef0e2906f684d Mon Sep 17 00:00:00 2001 From: mirelle7 <115191165+mirelle7@users.noreply.github.com> Date: Tue, 13 Oct 2026 23:57:12 +0200 Subject: [PATCH 4/7] ci(weekly): Ship VC6 and MSVC weekly builds Add an MSVC (vcpkg) weekly build next to the existing VC6 build, with retail compatibility and retail gameplay bugs disabled. The VC6 zips keep their original names; the MSVC zips get an -msvc suffix and a multi-language README. The release page explains which zip to download. Add RTS_BUILD_OPTION_PRESERVE_RETAIL_BEHAVIOR as a separate CMake option for the PRESERVE_ defines. --- .github/workflows/msvc-readme.txt | 49 +++++++++++++++++++++ .github/workflows/weekly-release.yml | 65 +++++++++++++++++++++++++++- CMakePresets.json | 29 +++++++++++++ cmake/config-retail.cmake | 7 +++ 4 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/msvc-readme.txt diff --git a/.github/workflows/msvc-readme.txt b/.github/workflows/msvc-readme.txt new file mode 100644 index 00000000000..33fedd9a3a3 --- /dev/null +++ b/.github/workflows/msvc-readme.txt @@ -0,0 +1,49 @@ +WARNING: This is a MSVC weekly build. It expects the data from +GeneralsGamePatch2 (https://github.com/TheSuperHackers/GeneralsGamePatch2). +Install it before playing, or the game may misbehave. + +All players must use the same weekly version. This build cannot play +multiplayer against the VC6 or retail builds. + +SAVE GAMES: Saves are not compatible with the VC6 or retail builds, and are only +guaranteed to load in the same weekly version they were made with. +Saves made with this build may not load there, and saves from those builds may +not load here. Back up your save games before using this build. + +-------------------------------------------------------------------------------- + +警告:这是 MSVC 版每周构建。它需要 GeneralsGamePatch2 +(https://github.com/TheSuperHackers/GeneralsGamePatch2)中的数据。 +请在游玩前安装,否则游戏可能出现异常。 + +所有玩家必须使用同一每周版本。此版本无法与 VC6 版或零售版进行多人联机。 + +存档:存档与 VC6 版或零售版不兼容,并且仅保证在创建它们的同一每周版本中可以读取。使用此版本创建的存档可能无法在 +那些版本中读取,那些版本的存档也可能无法在此版本中读取。使用此版本前请备份您的存档。 + +-------------------------------------------------------------------------------- + +ВНИМАНИЕ: это еженедельная сборка MSVC. Ей требуются данные из +GeneralsGamePatch2 (https://github.com/TheSuperHackers/GeneralsGamePatch2). +Установите его перед игрой, иначе игра может работать некорректно. + +Все игроки должны использовать одну и ту же еженедельную версию. Эта сборка +несовместима по сетевой игре со сборками VC6 и розничными версиями. + +СОХРАНЕНИЯ: сохранения несовместимы со сборками VC6 и розничными +версиями и гарантированно загружаются только в той же еженедельной версии, +в которой были созданы. Сохранения, созданные в этой сборке, могут не загрузиться там, а +сохранения из тех сборок могут не загрузиться здесь. Сделайте резервную копию +сохранений перед использованием этой сборки. + +-------------------------------------------------------------------------------- + +تحذير: هذا إصدار أسبوعي مبني بـ MSVC. يتطلب بيانات GeneralsGamePatch2 +(https://github.com/TheSuperHackers/GeneralsGamePatch2). +قم بتثبيته قبل اللعب، وإلا فقد لا تعمل اللعبة بشكل صحيح. + +يجب على جميع اللاعبين استخدام الإصدار الأسبوعي نفسه. هذا الإصدار غير متوافق مع اللعب الجماعي مع إصدارات VC6 أو الإصدارات التجارية. + +الحفظ: ملفات الحفظ غير متوافقة مع إصدارات VC6 أو الإصدارات التجارية، ولا يُضمن تحميلها إلا في نفس الإصدار الأسبوعي الذي أُنشئت به. +قد لا تُحمَّل ملفات الحفظ المنشأة بهذا الإصدار هناك، وقد لا تُحمَّل ملفات الحفظ من تلك الإصدارات هنا. +يرجى عمل نسخة احتياطية من ملفات الحفظ قبل استخدام هذا الإصدار. diff --git a/.github/workflows/weekly-release.yml b/.github/workflows/weekly-release.yml index 32d9e0ed10d..7ae58b9c95d 100644 --- a/.github/workflows/weekly-release.yml +++ b/.github/workflows/weekly-release.yml @@ -89,13 +89,18 @@ jobs: name: Build Generals${{ matrix.preset && '' }} permissions: contents: read + packages: write strategy: matrix: include: - preset: "windows-x86-vc6-weekly" tools: true extras: false - release: true + - preset: "windows-x86-msvc19-weekly" + tools: true + extras: false + vcpkg: true + ffmpeg: false fail-fast: false uses: ./.github/workflows/reusable-build-toolchain.yml with: @@ -103,6 +108,9 @@ jobs: preset: ${{ matrix.preset }} tools: ${{ matrix.tools }} extras: ${{ matrix.extras }} + vcpkg: ${{ matrix.vcpkg || false }} + ffmpeg: ${{ matrix.ffmpeg || false }} + secrets: inherit build-generalsmd: needs: [detect-scm-changes, get-date] @@ -110,13 +118,18 @@ jobs: name: Build GeneralsMD${{ matrix.preset && '' }} permissions: contents: read + packages: write strategy: matrix: include: - preset: "windows-x86-vc6-weekly" tools: true extras: false - release: true + - preset: "windows-x86-msvc19-weekly" + tools: true + extras: false + vcpkg: true + ffmpeg: true fail-fast: false uses: ./.github/workflows/reusable-build-toolchain.yml with: @@ -124,6 +137,9 @@ jobs: preset: ${{ matrix.preset }} tools: ${{ matrix.tools }} extras: ${{ matrix.extras }} + vcpkg: ${{ matrix.vcpkg || false }} + ffmpeg: ${{ matrix.ffmpeg || false }} + secrets: inherit create-release: name: Create Release @@ -179,6 +195,30 @@ jobs: run: | zip -jr generalszh-weekly-${{ needs.get-date.outputs.date }}.zip generalsmd-vc6-artifacts/* + # Generals MSVC (vcpkg) + - name: Download Generals MSVC Artifacts + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + with: + name: Generals-windows-x86-msvc19-weekly+t+v + path: generals-msvc-artifacts + + - name: Prepare and Zip Generals MSVC + run: | + cp .github/workflows/msvc-readme.txt generals-msvc-artifacts/README.txt + zip -jr generals-weekly-msvc-${{ needs.get-date.outputs.date }}.zip generals-msvc-artifacts/* + + # GeneralsMD MSVC (vcpkg) + - name: Download GeneralsMD MSVC Artifacts + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + with: + name: GeneralsMD-windows-x86-msvc19-weekly+t+v + path: generalsmd-msvc-artifacts + + - name: Prepare and Zip GeneralsMD MSVC + run: | + cp .github/workflows/msvc-readme.txt generalsmd-msvc-artifacts/README.txt + zip -jr generalszh-weekly-msvc-${{ needs.get-date.outputs.date }}.zip generalsmd-msvc-artifacts/* + - name: Generate release notes env: BUILD_NOTES: ${{ github.event.inputs.build_notes }} @@ -186,6 +226,22 @@ jobs: CHANGELOG_COMMITS: ${{ steps.changelog.outputs.commits }} run: | { + cat <<'NOTES_EOF' + ### Which download do I need? + | You want to... | Zero Hour | Generals | + |---|---|---| + | Play with players on retail or VC6, watch retail replays, or test for mismatches | `generalszh-weekly-${{ needs.get-date.outputs.date }}.zip` | `generals-weekly-${{ needs.get-date.outputs.date }}.zip` | + | Get the most bug fixes and play with other MSVC players | `generalszh-weekly-msvc-${{ needs.get-date.outputs.date }}.zip` | `generals-weekly-msvc-${{ needs.get-date.outputs.date }}.zip` | + + **MSVC** builds: + - Need the data from [GeneralsGamePatch2](https://github.com/TheSuperHackers/GeneralsGamePatch2). Install it before playing, or the game may misbehave. + - Cannot play multiplayer against VC6 or retail. All players must use the same weekly version. + - Use save games that are not compatible with VC6 or retail, and are only guaranteed to load in the same weekly version they were made with. Back up your saves first. + + ### Builds + - **VC6**: retail-compatible defaults. + - **MSVC**: vcpkg, retail compatibility off and all gameplay fixes on. + NOTES_EOF if [ -n "$BUILD_NOTES" ]; then printf '### Build notes\n%s\n' "$BUILD_NOTES" fi @@ -205,6 +261,8 @@ jobs: files: | generals-weekly-${{ needs.get-date.outputs.date }}.zip generalszh-weekly-${{ needs.get-date.outputs.date }}.zip + generals-weekly-msvc-${{ needs.get-date.outputs.date }}.zip + generalszh-weekly-msvc-${{ needs.get-date.outputs.date }}.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -212,6 +270,9 @@ jobs: if: always() run: | rm -rf generals-vc6-artifacts generalsmd-vc6-artifacts + rm -rf generals-msvc-artifacts generalsmd-msvc-artifacts rm -f generals-weekly-${{ needs.get-date.outputs.date }}.zip rm -f generalszh-weekly-${{ needs.get-date.outputs.date }}.zip + rm -f generals-weekly-msvc-${{ needs.get-date.outputs.date }}.zip + rm -f generalszh-weekly-msvc-${{ needs.get-date.outputs.date }}.zip rm -f release-notes.md diff --git a/CMakePresets.json b/CMakePresets.json index b4304b3b57b..43bcc429e45 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -108,6 +108,15 @@ "RTS_BUILD_OPTION_DEBUG": "ON" } }, + { + "name": "windows-x86-msvc19-weekly", + "inherits": "windows-x86-msvc19", + "displayName": "Windows 32bit MSVC19 Weekly Release", + "cacheVariables": { + "RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME": "OFF", + "RTS_BUILD_OPTION_PRESERVE_RETAIL_BEHAVIOR": "OFF" + } + }, { "name": "windows-x86-mingwgcc", "displayName": "MinGW-w64 32-bit (i686) Release", @@ -192,6 +201,13 @@ "description": "Build Windows 32bit MSVC19 Debug", "configuration": "Debug" }, + { + "name": "windows-x86-msvc19-weekly", + "configurePreset": "windows-x86-msvc19-weekly", + "displayName": "Build Windows 32bit MSVC19 Weekly Release", + "description": "Build Windows 32bit MSVC19 Weekly Release", + "configuration": "Release" + }, { "name": "windows-x86-mingwgcc", "configurePreset": "windows-x86-mingwgcc", @@ -354,6 +370,19 @@ } ] }, + { + "name": "windows-x86-msvc19-weekly", + "steps": [ + { + "type": "configure", + "name": "windows-x86-msvc19-weekly" + }, + { + "type": "build", + "name": "windows-x86-msvc19-weekly" + } + ] + }, { "name": "windows-x86-mingwgcc", "steps": [ diff --git a/cmake/config-retail.cmake b/cmake/config-retail.cmake index a9e6a279326..ffdb13f49df 100644 --- a/cmake/config-retail.cmake +++ b/cmake/config-retail.cmake @@ -7,6 +7,13 @@ collect_defines_from_file(_retail_guards "${CMAKE_CURRENT_SOURCE_DIR}/Core/GameE define_tristate_option(RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME RetailCompatibleGame "Build with Retail Compatibility" "${_retail_guards}" "") unset(_retail_guards) +set(RTS_BUILD_OPTION_PRESERVE_RETAIL_BEHAVIOR "DEFAULT" CACHE STRING "Preserve retail gameplay behavior. OFF applies the gameplay fixes that retail compatibility allows. DEFAULT follows GameDefines.h.") +set_property(CACHE RTS_BUILD_OPTION_PRESERVE_RETAIL_BEHAVIOR PROPERTY STRINGS DEFAULT ON OFF) + +collect_defines_from_file(_preserve_guards "${CMAKE_CURRENT_SOURCE_DIR}/Core/GameEngine/Include/Common/GameDefines.h" "PRESERVE_") +define_tristate_option(RTS_BUILD_OPTION_PRESERVE_RETAIL_BEHAVIOR PreserveRetailBehavior "Build preserving retail gameplay behavior" "${_preserve_guards}" "") +unset(_preserve_guards) + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "12.0.8804" AND NOT RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME STREQUAL "OFF") message(NOTICE "") message(NOTICE " Retail compatibility: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} is not CRC-compatible with retail.") From 50f55e00a1acb974a245e23a3630ac42fdee9a28 Mon Sep 17 00:00:00 2001 From: mirelle7 <115191165+mirelle7@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:41:54 +0200 Subject: [PATCH 5/7] ci(weekly): Grant packages: write only to the vcpkg build jobs The VC6 weekly builds do not use the vcpkg binary cache, so split each game's matrix into a VC6 job (contents: read) and a vcpkg job (contents: read, packages: write). # Conflicts: # .github/workflows/weekly-release.yml --- .github/workflows/weekly-release.yml | 82 +++++++++++++++------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/.github/workflows/weekly-release.yml b/.github/workflows/weekly-release.yml index 7ae58b9c95d..50ad9e9f9e7 100644 --- a/.github/workflows/weekly-release.yml +++ b/.github/workflows/weekly-release.yml @@ -83,67 +83,71 @@ jobs: echo "changed=true" >> $GITHUB_OUTPUT fi - build-generals: + build-generals-vc6: needs: [detect-scm-changes, get-date] if: needs.detect-scm-changes.outputs.changed == 'true' - name: Build Generals${{ matrix.preset && '' }} + name: Build Generals + permissions: + contents: read + uses: ./.github/workflows/reusable-build-toolchain.yml + with: + game: "Generals" + preset: "windows-x86-vc6-weekly" + tools: true + extras: false + secrets: inherit + + build-generals-msvc19: + needs: [detect-scm-changes, get-date] + if: needs.detect-scm-changes.outputs.changed == 'true' + name: Build Generals permissions: contents: read packages: write - strategy: - matrix: - include: - - preset: "windows-x86-vc6-weekly" - tools: true - extras: false - - preset: "windows-x86-msvc19-weekly" - tools: true - extras: false - vcpkg: true - ffmpeg: false - fail-fast: false uses: ./.github/workflows/reusable-build-toolchain.yml with: game: "Generals" - preset: ${{ matrix.preset }} - tools: ${{ matrix.tools }} - extras: ${{ matrix.extras }} - vcpkg: ${{ matrix.vcpkg || false }} - ffmpeg: ${{ matrix.ffmpeg || false }} + preset: "windows-x86-msvc19-weekly" + tools: true + extras: false + vcpkg: true + ffmpeg: false + secrets: inherit + + build-generalsmd-vc6: + needs: [detect-scm-changes, get-date] + if: needs.detect-scm-changes.outputs.changed == 'true' + name: Build GeneralsMD + permissions: + contents: read + uses: ./.github/workflows/reusable-build-toolchain.yml + with: + game: "GeneralsMD" + preset: "windows-x86-vc6-weekly" + tools: true + extras: false secrets: inherit - build-generalsmd: + build-generalsmd-msvc19: needs: [detect-scm-changes, get-date] if: needs.detect-scm-changes.outputs.changed == 'true' - name: Build GeneralsMD${{ matrix.preset && '' }} + name: Build GeneralsMD permissions: contents: read packages: write - strategy: - matrix: - include: - - preset: "windows-x86-vc6-weekly" - tools: true - extras: false - - preset: "windows-x86-msvc19-weekly" - tools: true - extras: false - vcpkg: true - ffmpeg: true - fail-fast: false uses: ./.github/workflows/reusable-build-toolchain.yml with: game: "GeneralsMD" - preset: ${{ matrix.preset }} - tools: ${{ matrix.tools }} - extras: ${{ matrix.extras }} - vcpkg: ${{ matrix.vcpkg || false }} - ffmpeg: ${{ matrix.ffmpeg || false }} + preset: "windows-x86-msvc19-weekly" + tools: true + extras: false + vcpkg: true + ffmpeg: true secrets: inherit create-release: name: Create Release - needs: [build-generals, build-generalsmd, get-date] + needs: [build-generals-vc6, build-generals-msvc19, build-generalsmd-vc6, build-generalsmd-msvc19, get-date] runs-on: ubuntu-latest permissions: contents: write From 38063df4e83ec3dce5c0a566ea5a9e4cbcccdbfe Mon Sep 17 00:00:00 2001 From: mirelle7 <115191165+mirelle7@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:46:05 +0200 Subject: [PATCH 6/7] fix(gameengine): Pass the default game title directly to FETCH_OR_SUBSTITUTE With ENABLE_GAMETEXT_SUBSTITUTES=0 the macro drops its substitute argument, so the defaultGameTitle variable was unused and C4189 broke the build. --- Generals/Code/GameEngine/Source/Common/GameEngine.cpp | 5 ++--- GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp index 039321096d0..2736ff6ecd8 100644 --- a/Generals/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/Generals/Code/GameEngine/Source/Common/GameEngine.cpp @@ -203,11 +203,10 @@ static void updateWindowTitle() } #if RTS_GENERALS - const WideChar* defaultGameTitle = L"Command and Conquer Generals"; + UnicodeString gameTitle = TheGameText->FETCH_OR_SUBSTITUTE("GUI:Command&ConquerGenerals", L"Command and Conquer Generals"); #elif RTS_ZEROHOUR - const WideChar* defaultGameTitle = L"Command and Conquer Generals Zero Hour"; + UnicodeString gameTitle = TheGameText->FETCH_OR_SUBSTITUTE("GUI:Command&ConquerGenerals", L"Command and Conquer Generals Zero Hour"); #endif - UnicodeString gameTitle = TheGameText->FETCH_OR_SUBSTITUTE("GUI:Command&ConquerGenerals", defaultGameTitle); if (!gameTitle.isEmpty()) { diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp index 5d7b450e1d4..80994078533 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp @@ -201,11 +201,10 @@ static void updateWindowTitle() } #if RTS_GENERALS - const WideChar* defaultGameTitle = L"Command and Conquer Generals"; + UnicodeString gameTitle = TheGameText->FETCH_OR_SUBSTITUTE("GUI:Command&ConquerGenerals", L"Command and Conquer Generals"); #elif RTS_ZEROHOUR - const WideChar* defaultGameTitle = L"Command and Conquer Generals Zero Hour"; + UnicodeString gameTitle = TheGameText->FETCH_OR_SUBSTITUTE("GUI:Command&ConquerGenerals", L"Command and Conquer Generals Zero Hour"); #endif - UnicodeString gameTitle = TheGameText->FETCH_OR_SUBSTITUTE("GUI:Command&ConquerGenerals", defaultGameTitle); if (!gameTitle.isEmpty()) { From 0c01f2dfe309ba48653f2b19d1584df8663ed1db Mon Sep 17 00:00:00 2001 From: mirelle7 <115191165+mirelle7@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:46:05 +0200 Subject: [PATCH 7/7] ci: Build a non-retail configuration on every pull request Add the windows-x86-msvc19-nonretail preset, which turns off retail compatibility, the preserved retail behavior and the optional engine features, so their code paths compile in CI. It is a CI-only build and is not shipped by the weekly release. --- .github/workflows/ci.yml | 6 ++++++ CMakePresets.json | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e110f24a84..3f164c5c0d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,6 +97,9 @@ jobs: - preset: "windows-x86-msvc19-debug" tools: true extras: true + - preset: "windows-x86-msvc19-nonretail" + tools: true + extras: true fail-fast: false uses: ./.github/workflows/reusable-build-toolchain.yml with: @@ -173,6 +176,9 @@ jobs: - preset: "windows-x86-msvc19-debug" tools: true extras: true + - preset: "windows-x86-msvc19-nonretail" + tools: true + extras: true fail-fast: false uses: ./.github/workflows/reusable-build-toolchain.yml with: diff --git a/CMakePresets.json b/CMakePresets.json index 43bcc429e45..60386ff9a18 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -108,6 +108,16 @@ "RTS_BUILD_OPTION_DEBUG": "ON" } }, + { + "name": "windows-x86-msvc19-nonretail", + "inherits": "windows-x86-msvc19", + "displayName": "Windows 32bit MSVC19 Non-Retail Release", + "cacheVariables": { + "RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME": "OFF", + "RTS_BUILD_OPTION_PRESERVE_RETAIL_BEHAVIOR": "OFF", + "RTS_FLAGS": "/W3;/DENABLE_GAMETEXT_SUBSTITUTES=0;/DENABLE_CONFIGURABLE_SHROUD=0;/DENABLE_FILESYSTEM_EXISTENCE_CACHE=0;/DPRIORITIZE_TEXTURES_BY_SIZE=0;/DENABLE_GUI_HACKS=0" + } + }, { "name": "windows-x86-msvc19-weekly", "inherits": "windows-x86-msvc19", @@ -201,6 +211,13 @@ "description": "Build Windows 32bit MSVC19 Debug", "configuration": "Debug" }, + { + "name": "windows-x86-msvc19-nonretail", + "configurePreset": "windows-x86-msvc19-nonretail", + "displayName": "Build Windows 32bit MSVC19 Non-Retail Release", + "description": "Build Windows 32bit MSVC19 Non-Retail Release", + "configuration": "Release" + }, { "name": "windows-x86-msvc19-weekly", "configurePreset": "windows-x86-msvc19-weekly", @@ -263,6 +280,14 @@ "displayName": "Test Windows 32bit MSVC19 Debug", "description": "Test Windows 32bit MSVC19 Debug", "configuration": "Debug" + }, + { + "name": "windows-x86-msvc19-nonretail", + "inherits": "default", + "configurePreset": "windows-x86-msvc19-nonretail", + "displayName": "Test Windows 32bit MSVC19 Non-Retail Release", + "description": "Test Windows 32bit MSVC19 Non-Retail Release", + "configuration": "Release" } ], "workflowPresets": [ @@ -370,6 +395,19 @@ } ] }, + { + "name": "windows-x86-msvc19-nonretail", + "steps": [ + { + "type": "configure", + "name": "windows-x86-msvc19-nonretail" + }, + { + "type": "build", + "name": "windows-x86-msvc19-nonretail" + } + ] + }, { "name": "windows-x86-msvc19-weekly", "steps": [