Skip to content

Commit 475bdd2

Browse files
committed
build.ps1: correct platform handling in Build-SPMProject
Ensure that we use the `$Platform.OS` rather than the hardcoded `Windows` value, which allows us to be setup for building for non-Windows hosts.
1 parent e50caba commit 475bdd2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/build.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,17 +1765,17 @@ function Build-SPMProject {
17651765
$RuntimeInstallRoot = [IO.Path]::Combine((Get-InstallDir $BuildPlatform), "Runtimes", $ProductVersion)
17661766

17671767
$env:Path = "$RuntimeInstallRoot\usr\bin;$($BuildPlatform.ToolchainInstallRoot)\usr\bin;${env:Path}"
1768-
$env:SDKROOT = (Get-SwiftSDK Windows)
1768+
$env:SDKROOT = (Get-SwiftSDK $Platform.OS)
17691769
$env:SWIFTCI_USE_LOCAL_DEPS = "1"
17701770

17711771
$Arguments = @(
17721772
"--scratch-path", $Bin,
17731773
"--package-path", $Src,
17741774
"-c", $Configuration,
1775-
"-Xbuild-tools-swiftc", "-I$(Get-SwiftSDK Windows)\usr\lib\swift",
1776-
"-Xbuild-tools-swiftc", "-L$(Get-SwiftSDK Windows)\usr\lib\swift\windows",
1777-
"-Xcc", "-I$(Get-SwiftSDK Windows)\usr\lib\swift",
1778-
"-Xlinker", "-L$(Get-SwiftSDK Windows)\usr\lib\swift\windows"
1775+
"-Xbuild-tools-swiftc", "-I$(Get-SwiftSDK $Platform.OS)\usr\lib\swift",
1776+
"-Xbuild-tools-swiftc", "-L$(Get-SwiftSDK $Platform.OS)\usr\lib\swift\windows",
1777+
"-Xcc", "-I$(Get-SwiftSDK $Platform.OS)\usr\lib\swift",
1778+
"-Xlinker", "-L$(Get-SwiftSDK $Platform.OS)\usr\lib\swift\windows"
17791779
)
17801780
if ($DebugInfo) {
17811781
if ($Platform.OS -eq [OS]::Windows -and $SwiftDebugFormat -eq "codeview") {

0 commit comments

Comments
 (0)