Skip to content

Commit 36e0716

Browse files
committed
Make it possible to specify the sccache storage location via a flag.
This allows the cache to be stored outside the binary cache.
1 parent fa72680 commit 36e0716

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

utils/build.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ If set, debug information will be generated for the builds.
7474
.PARAMETER EnableCaching
7575
If true, use `sccache` to cache the build rules.
7676
77+
.PARAMETER Cache
78+
The path to a directory where the `sccache` stores the cache. By default, it will point to `$BinaryCache\sccache`.
79+
7780
.PARAMETER Clean
7881
If true, clean non-compiler builds while building.
7982
@@ -128,6 +131,7 @@ param(
128131
[switch] $Clean,
129132
[switch] $DebugInfo,
130133
[switch] $EnableCaching,
134+
[string] $Cache = "",
131135
[switch] $Summary,
132136
[switch] $ToBatch
133137
)
@@ -855,7 +859,11 @@ function Build-CMakeProject {
855859

856860
if ($EnableCaching) {
857861
$env:SCCACHE_DIRECT = "true"
858-
$env:SCCACHE_DIR = "$BinaryCache\sccache"
862+
if ($Cache -eq "") {
863+
$env:SCCACHE_DIR = "$BinaryCache\sccache"
864+
} else {
865+
$env:SCCACHE_DIR = $Cache
866+
}
859867
}
860868
if ($UseSwiftSwiftDriver) {
861869
$env:SWIFT_DRIVER_SWIFT_FRONTEND_EXEC = ([IO.Path]::Combine($CompilersBinaryCache, "bin", "swift-frontend.exe"))

0 commit comments

Comments
 (0)