diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index e8946fad..cfbac284 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -47,6 +47,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ runner.os }}-android-bincache - name: Compile gkNextRenderer @@ -60,5 +61,6 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index aceea085..006e67a8 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -48,6 +48,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ runner.os }}-ios-bincache - name: Compile gkNextRenderer @@ -63,6 +64,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4c98cabb..72cb988b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -45,6 +45,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ runner.os }}-desktop-bincache - name: Compile gkNextRenderer @@ -58,6 +59,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 373e5a76..70d17777 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -48,6 +48,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ runner.os }}-desktop-bincache - name: Compile gkNextRenderer @@ -63,6 +64,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b1e4df2b..281edc02 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -44,6 +44,7 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ runner.os }}-desktop-bincache - name: Setup MSBuild @@ -63,4 +64,5 @@ jobs: path: | .vcpkg .vcpkg_bincache + .vcpkg_cache key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }} diff --git a/.gitignore b/.gitignore index 38d1046a..61ad0edd 100644 --- a/.gitignore +++ b/.gitignore @@ -369,3 +369,4 @@ src/ThirdParty/Streamline/ # Claude Code files .claude/ lib/ +.vcpkg_cache/ diff --git a/vcpkg.ps1 b/vcpkg.ps1 index 24df2696..9478535b 100644 --- a/vcpkg.ps1 +++ b/vcpkg.ps1 @@ -9,6 +9,13 @@ $ScriptDir = $PSScriptRoot $ProjectRoot = $ScriptDir $DefaultVcpkgRoot = Join-Path $ProjectRoot ".vcpkg" $VcpkgDefaultBinaryCache = Join-Path $ProjectRoot ".vcpkg_bincache" +$VcpkgDownloads = Join-Path $ProjectRoot ".vcpkg_cache/downloads" +$VcpkgRegistriesCache = Join-Path $ProjectRoot ".vcpkg_cache/registries" + +# Set Environment Variables +$env:VCPKG_BINARY_SOURCES = "clear;files,$VcpkgDefaultBinaryCache,readwrite" +$env:VCPKG_DOWNLOADS = $VcpkgDownloads +$env:X_VCPKG_REGISTRIES_CACHE = $VcpkgRegistriesCache # Configuration $VcpkgGitRef = "2025.12.12" @@ -37,6 +44,12 @@ foreach ($Arg in $AllArgs) { if (-not (Test-Path $VcpkgDefaultBinaryCache)) { New-Item -ItemType Directory -Path $VcpkgDefaultBinaryCache -Force | Out-Null } +if (-not (Test-Path $VcpkgDownloads)) { + New-Item -ItemType Directory -Path $VcpkgDownloads -Force | Out-Null +} +if (-not (Test-Path $VcpkgRegistriesCache)) { + New-Item -ItemType Directory -Path $VcpkgRegistriesCache -Force | Out-Null +} $VcpkgRoot = $env:VCPKG_ROOT if ([string]::IsNullOrWhiteSpace($VcpkgRoot)) { diff --git a/vcpkg.sh b/vcpkg.sh index d9ca5236..df453417 100755 --- a/vcpkg.sh +++ b/vcpkg.sh @@ -9,9 +9,18 @@ init_variables() { SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$SCRIPT_DIR" DEFAULT_VCPKG_ROOT="$PROJECT_ROOT/.vcpkg" - export VCPKG_DEFAULT_BINARY_CACHE="$PROJECT_ROOT/.vcpkg_bincache" - if [ ! -d "$VCPKG_DEFAULT_BINARY_CACHE" ]; then - mkdir -p "$VCPKG_DEFAULT_BINARY_CACHE" + export VCPKG_BINARY_SOURCES="clear;files,$PROJECT_ROOT/.vcpkg_bincache,readwrite" + export VCPKG_DOWNLOADS="$PROJECT_ROOT/.vcpkg_cache/downloads" + export X_VCPKG_REGISTRIES_CACHE="$PROJECT_ROOT/.vcpkg_cache/registries" + + if [ ! -d "$PROJECT_ROOT/.vcpkg_bincache" ]; then + mkdir -p "$PROJECT_ROOT/.vcpkg_bincache" + fi + if [ ! -d "$VCPKG_DOWNLOADS" ]; then + mkdir -p "$VCPKG_DOWNLOADS" + fi + if [ ! -d "$X_VCPKG_REGISTRIES_CACHE" ]; then + mkdir -p "$X_VCPKG_REGISTRIES_CACHE" fi VCPKG_ROOT="${VCPKG_ROOT:-$DEFAULT_VCPKG_ROOT}" VCPKG_EXE="$VCPKG_ROOT/vcpkg"