Skip to content

Commit 7cfcd29

Browse files
committed
build.ps1: separate SPM runtime build
1 parent 8f7af45 commit 7cfcd29

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

utils/build.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ enum Project {
850850
Subprocess
851851
Build
852852
PackageManager
853+
PackageManagerRuntime
853854
Markdown
854855
Format
855856
LMDB
@@ -3605,6 +3606,31 @@ function Build-PackageManager([Hashtable] $Platform) {
36053606
}
36063607
}
36073608

3609+
function Build-PackageManagerRuntime([Hashtable] $Platform) {
3610+
$SrcDir = if (Test-Path -Path "$SourceCache\swift-package-manager" -PathType Container) {
3611+
"$SourceCache\swift-package-manager"
3612+
} else {
3613+
"$SourceCache\swiftpm"
3614+
}
3615+
3616+
$SwiftSDK = if ($Platform.DefaultSDK -match "Experimental") {
3617+
Get-SwiftSDK -OS $Platform.OS -Identifier "$($Platform.OS)Experimental"
3618+
} else {
3619+
Get-SwiftSDK -OS $Platform.OS
3620+
}
3621+
Build-CMakeProject `
3622+
-Src $SrcDir\Sources\Runtimes `
3623+
-Bin (Get-ProjectBinaryCache $Platform PackageManagerRuntime) `
3624+
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
3625+
-Platform $Platform `
3626+
-UseBuiltCompilers C,CXX,Swift `
3627+
-SwiftSDK $SwiftSDK `
3628+
-UseGNUDriver `
3629+
-Defines @{
3630+
BUILD_SHARED_LIBS = "YES";
3631+
}
3632+
}
3633+
36083634
function Build-Markdown([Hashtable] $Platform) {
36093635
Build-CMakeProject `
36103636
-Src $SourceCache\swift-markdown `
@@ -4166,6 +4192,8 @@ if (-not $SkipBuild) {
41664192
}
41674193

41684194
Write-PlatformInfoPlist Windows
4195+
4196+
Invoke-BuildStep Build-PackageManagerRuntime $HostPlatform
41694197
}
41704198

41714199
if ($Android) {

0 commit comments

Comments
 (0)