Skip to content

Commit 92da0d3

Browse files
committed
utils: flesh out the experimental SDK and prepare to package
Adjust the build of the experimental SDK to build the overlays and the string processing library. Additionally adjust the installer build to allow us to package and distribute the static build of the runtime.
1 parent 9b6c04e commit 92da0d3

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

utils/build.ps1

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,8 @@ enum Project {
643643
ClangRuntime
644644
SwiftInspect
645645
ExperimentalRuntime
646+
ExperimentalOverlay
647+
ExperimentalStringProcessing
646648
StaticFoundation
647649
}
648650

@@ -2278,6 +2280,38 @@ function Build-ExperimentalRuntime {
22782280
dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
22792281
SwiftCore_ENABLE_CONCURRENCY = "YES";
22802282
}
2283+
2284+
Build-CMakeProject `
2285+
-Src $SourceCache\swift\Runtimes\Overlay `
2286+
-Bin (Get-ProjectBinaryCache $Platform ExperimentalOverlay) `
2287+
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2288+
-Platform $Platform `
2289+
-UseBuiltCompilers C,CXX,Swift `
2290+
-UseGNUDriver `
2291+
-Defines @{
2292+
BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
2293+
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
2294+
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform);
2295+
CMAKE_Swift_COMPILER_WORKS = "YES";
2296+
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
2297+
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
2298+
}
2299+
2300+
Build-CMakeProject `
2301+
-Src $SourceCache\swift\Runtimes\Supplemental\StringProcessing `
2302+
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStringProcessing) `
2303+
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2304+
-Platform $Platform `
2305+
-UseBuiltCompilers C,CXX,Swift `
2306+
-UseGNUDriver `
2307+
-Defines @{
2308+
BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
2309+
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
2310+
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform);
2311+
CMAKE_Swift_COMPILER_WORKS = "YES";
2312+
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
2313+
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
2314+
}
22812315
}
22822316
}
22832317

@@ -3130,6 +3164,7 @@ function Build-Installer([Hashtable] $Platform) {
31303164
$Properties = @{
31313165
BundleFlavor = "offline";
31323166
ImageRoot = "$(Get-InstallDir $Platform)\";
3167+
IncludeExperimentalSDK = "True";
31333168
INCLUDE_SWIFT_DOCC = $INCLUDE_SWIFT_DOCC;
31343169
SWIFT_DOCC_BUILD = "$(Get-ProjectBinaryCache $HostPlatform DocC)\release";
31353170
SWIFT_DOCC_RENDER_ARTIFACT_ROOT = "${SourceCache}\swift-docc-render-artifact";
@@ -3224,6 +3259,11 @@ if (-not $SkipBuild) {
32243259
Move-Item $_.FullName "$(Get-SwiftSDK Windows)\usr\lib\swift\windows\$($Platform.Architecture.LLVMName)\" | Out-Null
32253260
}
32263261

3262+
Get-ChildItem "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\usr\lib\swift_static\windows" -Filter "*.lib" -File -ErrorAction Ignore | ForEach-Object {
3263+
Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory"
3264+
Move-Item $_.FullName "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\usr\lib\swift_static\windows\$($Platform.Architecture.LLVMName)\" | Out-Null
3265+
}
3266+
32273267
Copy-Directory "$(Get-SwiftSDK Windows)\usr\bin" "$([IO.Path]::Combine((Get-InstallDir $Platform), "Runtimes", $ProductVersion, "usr"))"
32283268
}
32293269

@@ -3240,6 +3280,11 @@ if (-not $SkipBuild) {
32403280
Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory"
32413281
Move-Item $_.FullName "$(Get-SwiftSDK Android)\usr\lib\swift\android\$($Platform.Architecture.LLVMName)\" | Out-Null
32423282
}
3283+
3284+
Get-ChildItem "$(Get-SwiftSDK Android -Identifier AndroidExperimental)\usr\lib\swift_static\android" -File | Where-Object { $_.Name -match "*.a$|*.so$" } | ForEach-Object {
3285+
Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory"
3286+
Move-Item $_.FullName "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\usr\lib\swift_static\windows\$($Platform.Architecture.LLVMName)\" | Out-Null
3287+
}
32433288
}
32443289

32453290
Install-Platform $AndroidSDKPlatforms Android

0 commit comments

Comments
 (0)