diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 10afc857916..4fbe7b1a4d4 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -25,6 +25,11 @@ on: default: false type: boolean description: "Build extras" + ffmpeg: + required: false + default: false + type: boolean + description: "Build with FFMPEG support" jobs: build: @@ -154,7 +159,7 @@ jobs: "VCPKG_OVERLAY_TRIPLETS=${{ github.workspace }}\triplets" >> $env:GITHUB_ENV "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 = @( @@ -167,6 +172,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 b15bc3a3c9e..aadd88aee36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,6 +147,10 @@ jobs: #- preset: "win32-vcpkg" # tools: true # extras: true + #- preset: "win32-vcpkg" + # tools: true + # extras: true + # ffmpeg: true #- preset: "win32-vcpkg-profile" # tools: true # extras: true 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 9ce3c6667c3..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": "b02e341c927f16d991edbd915d8ea43eac52096c", - "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" ] + } + } +}