@@ -1564,6 +1564,20 @@ function Build-BuildTools($Arch) {
1564
1564
}
1565
1565
}
1566
1566
1567
+ function Write-PList {
1568
+ [CmdletBinding (PositionalBinding = $false )]
1569
+ param
1570
+ (
1571
+ [Parameter (Mandatory = $true )]
1572
+ [PSCustomObject ] $Settings ,
1573
+ [Parameter (Mandatory = $true )]
1574
+ [string ] $Path
1575
+ )
1576
+
1577
+ Invoke-Program " $ ( Get-PythonExecutable ) " - c " import plistlib; print(str(plistlib.dumps($ ( ($Settings | ConvertTo-JSON - Compress) -replace ' "' , " '" ) ), encoding='utf-8'))" `
1578
+ - OutFile $Path
1579
+ }
1580
+
1567
1581
function Build-Compilers () {
1568
1582
[CmdletBinding (PositionalBinding = $false )]
1569
1583
param
@@ -1716,8 +1730,13 @@ function Build-Compilers() {
1716
1730
})
1717
1731
}
1718
1732
1719
- Invoke-Program " $ ( Get-PythonExecutable ) " - c " import plistlib; print(str(plistlib.dumps({ 'Identifier': '${ToolchainIdentifier} ', 'FallbackLibrarySearchPaths': ['usr/bin'], 'Version': '${ProductVersion} ' }), encoding='utf-8'))" `
1720
- - OutFile " $ ( $Arch.ToolchainInstallRoot ) \ToolchainInfo.plist"
1733
+ $Settings = @ {
1734
+ FallbackLibrarySearchPaths = @ (" usr/bin" )
1735
+ Identifier = " ${ToolchainIdentifier} "
1736
+ Version = " ${ProductVersion} "
1737
+ }
1738
+
1739
+ Write-PList - Settings $Settings - Path " $ ( $Arch.ToolchainInstallRoot ) \ToolchainInfo.plist"
1721
1740
}
1722
1741
1723
1742
# Reference: https://github.com/microsoft/mimalloc/tree/dev/bin#minject
@@ -2139,13 +2158,14 @@ function Build-ExperimentalRuntime {
2139
2158
}
2140
2159
2141
2160
function Write-SDKSettingsPlist ([Platform ]$Platform , $Arch ) {
2161
+ $SDKSettings = @ {
2162
+ DefaultProperties = @ {
2163
+ }
2164
+ }
2142
2165
if ($Platform -eq [Platform ]::Windows) {
2143
- Invoke-Program " $ ( Get-PythonExecutable ) " - c " import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }), encoding='utf-8'))" `
2144
- - OutFile " $ ( $Arch.SDKInstallRoot ) \SDKSettings.plist"
2145
- } else {
2146
- Invoke-Program " $ ( Get-PythonExecutable ) " - c " import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { } }), encoding='utf-8'))" `
2147
- - OutFile " $ ( $Arch.SDKInstallRoot ) \SDKSettings.plist"
2166
+ $SDKSettings.DefaultProperties.DEFAULT_USE_RUNTIME = " MD"
2148
2167
}
2168
+ Write-PList - Settings $SDKSettings - Path " $ ( $Arch.SDKInstallRoot ) \SDKSettings.plist"
2149
2169
2150
2170
$SDKSettings = @ {
2151
2171
CanonicalName = " $ ( $Arch.LLVMTarget ) "
@@ -2397,8 +2417,17 @@ function Build-Testing([Platform]$Platform, $Arch, [switch]$Test = $false) {
2397
2417
}
2398
2418
2399
2419
function Write-PlatformInfoPlist ([Platform ] $Platform ) {
2400
- Invoke-Program " $ ( Get-PythonExecutable ) " - c " import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development', 'SWIFT_TESTING_VERSION': 'development', 'SWIFTC_FLAGS': ['-use-ld=lld'] } }), encoding='utf-8'))" `
2401
- - OutFile ([IO.Path ]::Combine((Get-PlatformRoot $Platform ), " Info.plist" ))
2420
+ $Settings = @ {
2421
+ DefaultProperties = @ {
2422
+ SWIFT_TESTING_VERSION = " development"
2423
+ XCTEST_VERSION = " development"
2424
+ }
2425
+ }
2426
+ if ($Platform -eq [Platform ]::Windows) {
2427
+ $Settings.DefaultProperties.SWIFTC_FLAGS = @ ( " -use-ld=lld" )
2428
+ }
2429
+
2430
+ Write-PList - Settings $Settings - Path " $ ( Get-PlatformRoot $Platform ) \Info.plist"
2402
2431
}
2403
2432
2404
2433
# Copies files installed by CMake from the arch-specific platform root,
0 commit comments