From 105e7e31a304d2f39b4a0453c5ec9e8adba354e4 Mon Sep 17 00:00:00 2001 From: Oleksandr Kalko Date: Thu, 20 Aug 2026 23:55:24 +0300 Subject: [PATCH 1/5] feat(build): Define FFMPEG as VCPKG feature, disabled by default --- CMakeLists.txt | 6 ++++++ cmake/config-build.cmake | 1 - vcpkg.json | 21 +++++++++++++-------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39062e3fbe6..e9576889ad7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,12 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") endif() +# Define VCPKG feature before `project` block +option(RTS_BUILD_OPTION_FFMPEG "Enable FFmpeg support" OFF) +if(RTS_BUILD_OPTION_FFMPEG) + list(APPEND VCPKG_MANIFEST_FEATURES "ffmpeg") +endif() + # Top level project, doesn't really affect anything. project(genzh LANGUAGES C CXX) diff --git a/cmake/config-build.cmake b/cmake/config-build.cmake index 7973f5a1f03..d0201bed604 100644 --- a/cmake/config-build.cmake +++ b/cmake/config-build.cmake @@ -8,7 +8,6 @@ option(RTS_BUILD_OPTION_PROFILE_TRACY "Build code with Tracy profiling enabled." option(RTS_BUILD_OPTION_DEBUG "Build code with the \"Debug\" configuration." OFF) option(RTS_BUILD_OPTION_ASAN "Build code with Address Sanitizer." OFF) option(RTS_BUILD_OPTION_VC6_FULL_DEBUG "Build VC6 with full debug info." OFF) -option(RTS_BUILD_OPTION_FFMPEG "Enable FFmpeg support" OFF) if(NOT RTS_BUILD_ZEROHOUR AND NOT RTS_BUILD_GENERALS) set(RTS_BUILD_ZEROHOUR TRUE) diff --git a/vcpkg.json b/vcpkg.json index 6242036392f..d539cf4f0e7 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,9 +1,14 @@ { - "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", - "builtin-baseline": "9e593bb18ea69cc5095e012465dcd675a822ed0d", - "dependencies": [ - "zlib", - "ffmpeg", - "stb" - ] - } \ No newline at end of file + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "builtin-baseline": "b02e341c927f16d991edbd915d8ea43eac52096c", + "dependencies": [ + "zlib", + "stb" + ], + "features": { + "ffmpeg": { + "description": "Use FFMPEG instead of Bink for cutscene rendering", + "dependencies": [ "ffmpeg" ] + } + } +} From af479adebf414e0cccea1a2da2716f3927d9e3bf Mon Sep 17 00:00:00 2001 From: Oleksandr Kalko Date: Sat, 22 Aug 2026 19:37:00 +0300 Subject: [PATCH 2/5] feat(build): Define FFMPEG as VCPKG feature, disabled by default --- .github/workflows/build-toolchain.yml | 8 +++++++- .github/workflows/ci.yml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index de225c4813a..52db28fc36e 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -26,6 +26,11 @@ on: default: false type: boolean description: "Build extras" + ffmpeg: + required: false + default: false + type: boolean + description: "Build with FFMPEG support" jobs: build: @@ -133,7 +138,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.ffmpeg && '+ffmpeg'}} Preset shell: pwsh run: | $buildFlags = @( @@ -146,6 +151,7 @@ jobs: $buildFlags += "-DRTS_BUILD_${gamePrefix}_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}" $buildFlags += "-DRTS_BUILD_CORE_EXTRAS=${{ inputs.extras && 'ON' || 'OFF' }}" $buildFlags += "-DRTS_BUILD_${gamePrefix}_EXTRAS=${{ inputs.extras && 'ON' || 'OFF' }}" + $buildFlags += "-DRTS_BUILD_OPTION_FFMPEG=${{ inputs.ffmpeg && 'ON' || 'OFF' }}" Write-Host "Build flags: $($buildFlags -join ' | ')" cmake --preset ${{ inputs.preset }} $buildFlags diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90966e065ba..c7a42573e2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,6 +149,7 @@ jobs: - preset: "win32-vcpkg" tools: true extras: true + ffmpeg: true - preset: "win32-vcpkg-profile" tools: true extras: true From 7d42773fb2cb96944ec4e605157225590988c901 Mon Sep 17 00:00:00 2001 From: Oleksandr Kalko Date: Sun, 23 Aug 2026 16:19:26 +0300 Subject: [PATCH 3/5] Review feedback --- .github/workflows/build-toolchain.yml | 2 +- .github/workflows/ci.yml | 1 + vcpkg.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 52db28fc36e..7e8dc62ddd3 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -138,7 +138,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' || '' }}${{ inputs.ffmpeg && '+ffmpeg'}} Preset + - name: Configure ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}${{ inputs.ffmpeg && '+ffmpeg' || '' }} Preset shell: pwsh run: | $buildFlags = @( diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7a42573e2c..7c2e4bf42ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,6 +163,7 @@ jobs: preset: ${{ matrix.preset }} tools: ${{ matrix.tools }} extras: ${{ matrix.extras }} + ffmpeg: ${{ matrix.ffmpeg || false}} secrets: inherit replaycheck-generalsmd: diff --git a/vcpkg.json b/vcpkg.json index d539cf4f0e7..2280f4af63c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", - "builtin-baseline": "b02e341c927f16d991edbd915d8ea43eac52096c", + "builtin-baseline": "9e593bb18ea69cc5095e012465dcd675a822ed0d", "dependencies": [ "zlib", "stb" From 07fe8c71c3a84c1f07583d340d4f906f263b9283 Mon Sep 17 00:00:00 2001 From: Oleksandr Kalko Date: Sat, 29 Aug 2026 22:00:39 +0300 Subject: [PATCH 4/5] Use separate file for VCPKG features --- CMakeLists.txt | 5 +---- cmake/vcpkg.cmake | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 cmake/vcpkg.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e9576889ad7..ceeabaf5edb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,10 +31,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) endif() # Define VCPKG feature before `project` block -option(RTS_BUILD_OPTION_FFMPEG "Enable FFmpeg support" OFF) -if(RTS_BUILD_OPTION_FFMPEG) - list(APPEND VCPKG_MANIFEST_FEATURES "ffmpeg") -endif() +include(cmake/vcpkg.cmake) # Top level project, doesn't really affect anything. project(genzh LANGUAGES C CXX) diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake new file mode 100644 index 00000000000..81fa8f0b4ce --- /dev/null +++ b/cmake/vcpkg.cmake @@ -0,0 +1,6 @@ +# Contains options for VCPKG features + +option(RTS_BUILD_OPTION_FFMPEG "Enable FFmpeg support" OFF) +if(RTS_BUILD_OPTION_FFMPEG) + list(APPEND VCPKG_MANIFEST_FEATURES "ffmpeg") +endif() From 4730c34c7b3e5a1027d3a0193e7bf3cde74ee826 Mon Sep 17 00:00:00 2001 From: Oleksandr Kalko Date: Tue, 1 Sep 2026 13:28:54 +0300 Subject: [PATCH 5/5] Review feedback, round 2 --- .github/workflows/build-toolchain.yml | 2 +- CMakeLists.txt | 5 +++-- cmake/{vcpkg.cmake => config-vcpkg.cmake} | 0 vcpkg.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename cmake/{vcpkg.cmake => config-vcpkg.cmake} (100%) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 7e8dc62ddd3..ed668ab67d5 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -30,7 +30,7 @@ on: required: false default: false type: boolean - description: "Build with FFMPEG support" + description: "Build with FFmpeg support" jobs: build: diff --git a/CMakeLists.txt b/CMakeLists.txt index ceeabaf5edb..9ee9c7de0c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,8 +30,9 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") endif() -# Define VCPKG feature before `project` block -include(cmake/vcpkg.cmake) +# Define VCPKG feature before the project block +# since they need to be initialized before the toolchain is +include(cmake/config-vcpkg.cmake) # Top level project, doesn't really affect anything. project(genzh LANGUAGES C CXX) diff --git a/cmake/vcpkg.cmake b/cmake/config-vcpkg.cmake similarity index 100% rename from cmake/vcpkg.cmake rename to cmake/config-vcpkg.cmake diff --git a/vcpkg.json b/vcpkg.json index 2280f4af63c..22db4fd2b7a 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,7 +7,7 @@ ], "features": { "ffmpeg": { - "description": "Use FFMPEG instead of Bink for cutscene rendering", + "description": "Use FFmpeg instead of Bink for video rendering", "dependencies": [ "ffmpeg" ] } }