Skip to content

Commit 0a9edf3

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 69c5a02 commit 0a9edf3

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

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

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

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

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

32463291
Install-Platform $AndroidSDKPlatforms Android

0 commit comments

Comments
 (0)