@@ -643,6 +643,10 @@ enum Project {
643
643
ClangRuntime
644
644
SwiftInspect
645
645
ExperimentalRuntime
646
+ ExperimentalOverlay
647
+ ExperimentalStringProcessing
648
+ ExperimentalSynchronization
649
+ ExperimentalDispatch
646
650
StaticFoundation
647
651
}
648
652
@@ -2276,21 +2280,96 @@ function Build-ExperimentalRuntime {
2276
2280
CMAKE_Swift_COMPILER_WORKS = " YES" ;
2277
2281
CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2278
2282
CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2283
+
2284
+ # NOTE(compnerd) we can get away with this currently because we only
2285
+ # use the C portion of the dispatch build, which is always built
2286
+ # dynamically.
2279
2287
dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
2280
2288
SwiftCore_ENABLE_CONCURRENCY = " YES" ;
2281
2289
}
2290
+
2291
+ Build-CMakeProject `
2292
+ - Src $SourceCache \swift\Runtimes\Overlay `
2293
+ - Bin (Get-ProjectBinaryCache $Platform ExperimentalOverlay) `
2294
+ - InstallTo " $ ( Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental" ) \usr" `
2295
+ - Platform $Platform `
2296
+ - UseBuiltCompilers C, CXX, Swift `
2297
+ - UseGNUDriver `
2298
+ - Defines @ {
2299
+ BUILD_SHARED_LIBS = if ($Static ) { " NO" } else { " YES" };
2300
+ CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
2301
+ CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform );
2302
+ CMAKE_Swift_COMPILER_WORKS = " YES" ;
2303
+ CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2304
+ CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2305
+ }
2306
+
2307
+ Build-CMakeProject `
2308
+ - Src $SourceCache \swift\Runtimes\Supplemental\StringProcessing `
2309
+ - Bin (Get-ProjectBinaryCache $Platform ExperimentalStringProcessing) `
2310
+ - InstallTo " $ ( Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental" ) \usr" `
2311
+ - Platform $Platform `
2312
+ - UseBuiltCompilers C, Swift `
2313
+ - UseGNUDriver `
2314
+ - Defines @ {
2315
+ BUILD_SHARED_LIBS = if ($Static ) { " NO" } else { " YES" };
2316
+ CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
2317
+ CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform );
2318
+ CMAKE_Swift_COMPILER_WORKS = " YES" ;
2319
+ CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2320
+ CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2321
+ }
2322
+
2323
+ Build-CMakeProject `
2324
+ - Src $SourceCache \swift\Runtimes\Supplemental\Synchronization `
2325
+ - Bin (Get-ProjectBinaryCache $Platform ExperimentalSynchronization) `
2326
+ - InstallTo " $ ( Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental" ) \usr" `
2327
+ - Platform $Platform `
2328
+ - UseBuiltCompilers C, Swift `
2329
+ - UseGNUDriver `
2330
+ - Defines @ {
2331
+ BUILD_SHARED_LIBS = if ($Static ) { " NO" } else { " YES" };
2332
+ CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
2333
+ CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform );
2334
+ CMAKE_Swift_COMPILER_WORKS = " YES" ;
2335
+ CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2336
+ CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2337
+ }
2338
+
2339
+ # FIXME(compnerd) workaround the build not copying the clang resources into place
2340
+ if ($Static ) {
2341
+ & " $ninja " - C $ (Get-ProjectBinaryCache $BuildPlatform Compilers) symlink_clang_headers_static
2342
+ }
2343
+ Build-CMakeProject `
2344
+ - Src $SourceCache \swift- corelibs- libdispatch `
2345
+ - Bin (Get-ProjectBinaryCache $Platform ExperimentalDispatch) `
2346
+ - InstallTo " $ ( Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental" ) \usr" `
2347
+ - Platform $Platform `
2348
+ - UseBuiltCompilers C, CXX, Swift `
2349
+ - SwiftSDK (Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental" ) `
2350
+ - Defines @ {
2351
+ BUILD_SHARED_LIBS = if ($Static ) { " NO" } else { " YES" };
2352
+ CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
2353
+ CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform );
2354
+ CMAKE_Swift_COMPILER_WORKS = " YES" ;
2355
+ CMAKE_Swift_FLAGS = if ($Static ) { @ (" -static-stdlib" , " -Xfrontend" , " -use-static-resource-dir" ) } else { " " };
2356
+ CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2357
+ CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2358
+
2359
+ ENABLE_SWIFT = " YES" ;
2360
+ }
2282
2361
}
2283
2362
}
2284
2363
2285
- function Write-SDKSettingsPlist ([OS ] $OS ) {
2364
+ function Write-SDKSettingsPlist ([OS ] $OS , [ string ] $Identifier = $OS .ToString () ) {
2286
2365
$SDKSettings = @ {
2287
2366
DefaultProperties = @ {
2288
2367
}
2289
2368
}
2290
2369
if ($OS -eq [OS ]::Windows) {
2291
2370
$SDKSettings.DefaultProperties.DEFAULT_USE_RUNTIME = " MD"
2292
2371
}
2293
- Write-PList - Settings $SDKSettings - Path " $ ( Get-SwiftSDK $OS ) \SDKSettings.plist"
2372
+ Write-PList - Settings $SDKSettings - Path " $ ( Get-SwiftSDK $OS - Identifier $Identifier ) \SDKSettings.plist"
2294
2373
2295
2374
$SDKSettings = @ {
2296
2375
CanonicalName = $OS.ToString ()
@@ -2324,7 +2403,7 @@ function Write-SDKSettingsPlist([OS] $OS) {
2324
2403
$SDKSettings.SupportedTargets.android.Archs = $AndroidSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName } | Sort-Object
2325
2404
}
2326
2405
}
2327
- $SDKSettings | ConvertTo-JSON - Depth 4 | Out-FIle - FilePath " $ ( Get-SwiftSDK $OS ) \SDKSettings.json"
2406
+ $SDKSettings | ConvertTo-JSON - Depth 4 | Out-FIle - FilePath " $ ( Get-SwiftSDK $OS - Identifier $Identifier ) \SDKSettings.json"
2328
2407
}
2329
2408
2330
2409
function Build-Dispatch ([Hashtable ] $Platform ) {
@@ -3225,12 +3304,18 @@ if (-not $SkipBuild) {
3225
3304
Move-Item $_.FullName " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows\$ ( $Platform.Architecture.LLVMName ) \" | Out-Null
3226
3305
}
3227
3306
3307
+ Get-ChildItem " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static\windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3308
+ Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3309
+ Move-Item $_.FullName " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static\windows\$ ( $Platform.Architecture.LLVMName ) \" | Out-Null
3310
+ }
3311
+
3228
3312
Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Platform ), " Runtimes" , $ProductVersion , " usr" )) "
3229
3313
}
3230
3314
3231
3315
Install-Platform $WindowsSDKPlatforms Windows
3232
3316
Write-PlatformInfoPlist Windows
3233
3317
Write-SDKSettingsPlist Windows
3318
+ Write-SDKSettingsPlist Windows - Identifier WindowsExperimental
3234
3319
3235
3320
if ($Android ) {
3236
3321
foreach ($Platform in $AndroidSDKPlatforms ) {
@@ -3241,11 +3326,17 @@ if (-not $SkipBuild) {
3241
3326
Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3242
3327
Move-Item $_.FullName " $ ( Get-SwiftSDK Android) \usr\lib\swift\android\$ ( $Platform.Architecture.LLVMName ) \" | Out-Null
3243
3328
}
3329
+
3330
+ Get-ChildItem " $ ( Get-SwiftSDK Android - Identifier AndroidExperimental) \usr\lib\swift_static\android" - File | Where-Object { $_.Name -match " *.a$|*.so$" } | ForEach-Object {
3331
+ Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3332
+ Move-Item $_.FullName " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static\windows\$ ( $Platform.Architecture.LLVMName ) \" | Out-Null
3333
+ }
3244
3334
}
3245
3335
3246
3336
Install-Platform $AndroidSDKPlatforms Android
3247
3337
Write-PlatformInfoPlist Android
3248
3338
Write-SDKSettingsPlist Android
3339
+ Write-SDKSettingsPlist Android - Identifier AndroidExperimental
3249
3340
3250
3341
# Android swift-inspect only supports 64-bit platforms.
3251
3342
$AndroidSDKPlatforms | Where-Object { @ (" arm64-v8a" , " x86_64" ) -contains $_.Architecture.ABI } | ForEach-Object {
0 commit comments