Skip to content

Commit 8ee61aa

Browse files
authored
Merge pull request swiftlang#75957 from hjyamauchi/cacheflag
Make it possible to specify the sccache storage location via a flag.
2 parents ebe1769 + 36e0716 commit 8ee61aa

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
@@ -129,6 +132,7 @@ param(
129132
[switch] $Clean,
130133
[switch] $DebugInfo,
131134
[switch] $EnableCaching,
135+
[string] $Cache = "",
132136
[switch] $Summary,
133137
[switch] $ToBatch
134138
)
@@ -868,7 +872,11 @@ function Build-CMakeProject {
868872

869873
if ($EnableCaching) {
870874
$env:SCCACHE_DIRECT = "true"
871-
$env:SCCACHE_DIR = "$BinaryCache\sccache"
875+
if ($Cache -eq "") {
876+
$env:SCCACHE_DIR = "$BinaryCache\sccache"
877+
} else {
878+
$env:SCCACHE_DIR = $Cache
879+
}
872880
}
873881
if ($UseSwiftSwiftDriver) {
874882
$env:SWIFT_DRIVER_SWIFT_FRONTEND_EXEC = ([IO.Path]::Combine($CompilersBinaryCache, "bin", "swift-frontend.exe"))

0 commit comments

Comments
 (0)