@@ -1184,7 +1184,7 @@ function Build-CMakeProject {
1184
1184
}
1185
1185
}
1186
1186
1187
- if (" " -ne $InstallTo ) {
1187
+ if ($BuildTargets .Length -eq 0 -and $InstallTo ) {
1188
1188
Invoke-Program cmake.exe -- build $Bin -- target install
1189
1189
}
1190
1190
}
@@ -1321,7 +1321,6 @@ function Build-CMark($Arch) {
1321
1321
- Bin " $ ( $Arch.BinaryCache ) \cmark-gfm-0.29.0.gfm.13" `
1322
1322
- InstallTo " $ ( $Arch.ToolchainInstallRoot ) \usr" `
1323
1323
- Arch $Arch `
1324
- - BuildTargets default `
1325
1324
- Defines @ {
1326
1325
BUILD_SHARED_LIBS = " YES" ;
1327
1326
BUILD_TESTING = " NO" ;
@@ -1489,7 +1488,6 @@ function Build-ZLib([Platform]$Platform, $Arch) {
1489
1488
- Arch $Arch `
1490
1489
- Platform $Platform `
1491
1490
- UseMSVCCompilers C `
1492
- - BuildTargets default `
1493
1491
- Defines @ {
1494
1492
BUILD_SHARED_LIBS = " NO" ;
1495
1493
CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
@@ -1509,7 +1507,6 @@ function Build-XML2([Platform]$Platform, $Arch) {
1509
1507
- Arch $Arch `
1510
1508
- Platform $Platform `
1511
1509
- UseMSVCCompilers C, CXX `
1512
- - BuildTargets default `
1513
1510
- Defines @ {
1514
1511
BUILD_SHARED_LIBS = " NO" ;
1515
1512
CMAKE_INSTALL_BINDIR = " bin/$Platform /$ArchName " ;
@@ -1576,7 +1573,6 @@ function Build-CURL([Platform]$Platform, $Arch) {
1576
1573
- Arch $Arch `
1577
1574
- Platform $Platform `
1578
1575
- UseMSVCCompilers C `
1579
- - BuildTargets default `
1580
1576
- Defines ($PlatformDefines + @ {
1581
1577
BUILD_SHARED_LIBS = " NO" ;
1582
1578
BUILD_TESTING = " NO" ;
@@ -1699,7 +1695,6 @@ function Build-Runtime([Platform]$Platform, $Arch) {
1699
1695
- Platform $Platform `
1700
1696
- CacheScript $SourceCache \swift\cmake\caches\Runtime- $Platform - $ ($Arch.LLVMName ).cmake `
1701
1697
- UseBuiltCompilers C, CXX, Swift `
1702
- - BuildTargets default `
1703
1698
- Defines ($PlatformDefines + @ {
1704
1699
CMAKE_Swift_COMPILER_TARGET = $Arch.LLVMTarget.Replace (" $AndroidAPILevel " , " " );
1705
1700
CMAKE_Swift_COMPILER_WORKS = " YES" ;
@@ -1740,7 +1735,6 @@ function Build-Dispatch([Platform]$Platform, $Arch, [switch]$Test = $false) {
1740
1735
- Arch $Arch `
1741
1736
- Platform $Platform `
1742
1737
- UseBuiltCompilers C, CXX, Swift `
1743
- - BuildTargets $Targets `
1744
1738
- Defines @ {
1745
1739
ENABLE_SWIFT = " YES" ;
1746
1740
}
@@ -1783,9 +1777,11 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1783
1777
$ShortArch = $Arch.LLVMName
1784
1778
1785
1779
Isolate- EnvVars {
1786
- $TestingDefines = @ { ENABLE_TESTING = " NO" }
1787
- $Targets = @ (" default" )
1788
- $InstallPath = " $ ( $Arch.SDKInstallRoot ) \usr"
1780
+ $SDKRoot = if ($Platform -eq " Windows" ) {
1781
+ " "
1782
+ } else {
1783
+ (Get-Variable " ${Platform} $ ( $Arch.ShortName ) " - ValueOnly).SDKInstallRoot
1784
+ }
1789
1785
1790
1786
$SDKRoot = if ($Platform -eq " Windows" ) {
1791
1787
" "
@@ -1796,12 +1792,13 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1796
1792
Build-CMakeProject `
1797
1793
- Src $SourceCache \swift- corelibs- foundation `
1798
1794
- Bin $FoundationBinaryCache `
1799
- - InstallTo $InstallPath `
1795
+ - InstallTo " $ ( $Arch .SDKInstallRoot ) \usr " `
1800
1796
- Arch $Arch `
1801
1797
- Platform $Platform `
1802
1798
- UseBuiltCompilers ASM, C, CXX, Swift `
1803
- - BuildTargets $Targets `
1799
+ - SwiftSDK: $SDKRoot `
1804
1800
- Defines (@ {
1801
+ ENABLE_TESTING = " NO" ;
1805
1802
FOUNDATION_BUILD_TOOLS = if ($Platform -eq " Windows" ) { " YES" } else { " NO" };
1806
1803
CURL_DIR = " $LibraryRoot \curl-8.9.1\usr\lib\$Platform \$ShortArch \cmake\CURL" ;
1807
1804
LIBXML2_LIBRARY = if ($Platform -eq " Windows" ) {
@@ -1823,7 +1820,7 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1823
1820
_SwiftFoundationICU_SourceDIR = " $SourceCache \swift-foundation-icu" ;
1824
1821
_SwiftCollections_SourceDIR = " $SourceCache \swift-collections" ;
1825
1822
SwiftFoundation_MACRO = " $ ( Get-BuildProjectBinaryCache FoundationMacros) \bin"
1826
- } + $TestingDefines )
1823
+ })
1827
1824
}
1828
1825
}
1829
1826
}
@@ -1850,15 +1847,11 @@ function Build-FoundationMacros() {
1850
1847
$SwiftSDK = $BuildArch.SDKInstallRoot
1851
1848
}
1852
1849
1853
- $Targets = if ($Build ) {
1854
- @ (" default" )
1855
- } else {
1856
- @ (" default" , " install" )
1857
- }
1858
-
1859
1850
$InstallDir = $null
1851
+ $Targets = @ (" default" )
1860
1852
if (-not $Build ) {
1861
1853
$InstallDir = " $ ( $Arch.ToolchainInstallRoot ) \usr"
1854
+ $Targets = @ ()
1862
1855
}
1863
1856
1864
1857
$SwiftSyntaxCMakeModules = if ($Build -and $HostArch -ne $BuildArch ) {
@@ -1875,7 +1868,7 @@ function Build-FoundationMacros() {
1875
1868
- Platform $Platform `
1876
1869
- UseBuiltCompilers Swift `
1877
1870
- SwiftSDK:$SwiftSDK `
1878
- - BuildTargets $Targets `
1871
+ - BuildTargets: $Targets `
1879
1872
- Defines @ {
1880
1873
SwiftSyntax_DIR = $SwiftSyntaxCMakeModules ;
1881
1874
}
@@ -1900,7 +1893,7 @@ function Build-XCTest([Platform]$Platform, $Arch, [switch]$Test = $false) {
1900
1893
$env: Path = " $XCTestBinaryCache ;$FoundationBinaryCache \bin;$DispatchBinaryCache ;$ ( Get-TargetProjectBinaryCache $Arch Runtime) \bin;$env: Path ;$UnixToolsBinDir "
1901
1894
} else {
1902
1895
$TestingDefines = @ { ENABLE_TESTING = " NO" }
1903
- $Targets = @ (" default " )
1896
+ $Targets = @ (" install " )
1904
1897
$InstallPath = " $ ( $Arch.XCTestInstallRoot ) \usr"
1905
1898
}
1906
1899
@@ -1928,7 +1921,6 @@ function Build-Testing([Platform]$Platform, $Arch, [switch]$Test = $false) {
1928
1921
# TODO: Test
1929
1922
return
1930
1923
} else {
1931
- $Targets = @ (" default" )
1932
1924
$InstallPath = " $ ( $Arch.SwiftTestingInstallRoot ) \usr"
1933
1925
}
1934
1926
@@ -1939,7 +1931,6 @@ function Build-Testing([Platform]$Platform, $Arch, [switch]$Test = $false) {
1939
1931
- Arch $Arch `
1940
1932
- Platform $Platform `
1941
1933
- UseBuiltCompilers C, CXX, Swift `
1942
- - BuildTargets $Targets `
1943
1934
- Defines (@ {
1944
1935
BUILD_SHARED_LIBS = " YES" ;
1945
1936
CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
@@ -2038,7 +2029,6 @@ function Build-SQLite($Arch) {
2038
2029
- InstallTo $LibraryRoot \sqlite- 3.46 .0 \usr `
2039
2030
- Arch $Arch `
2040
2031
- UseMSVCCompilers C `
2041
- - BuildTargets default `
2042
2032
- Defines @ {
2043
2033
BUILD_SHARED_LIBS = " NO" ;
2044
2034
}
@@ -2053,7 +2043,6 @@ function Build-System($Arch) {
2053
2043
- Platform Windows `
2054
2044
- UseBuiltCompilers C, Swift `
2055
2045
- SwiftSDK (Get-HostSwiftSDK ) `
2056
- - BuildTargets default `
2057
2046
- Defines @ {
2058
2047
BUILD_SHARED_LIBS = " YES" ;
2059
2048
}
@@ -2073,7 +2062,6 @@ function Build-ToolsSupportCore($Arch) {
2073
2062
- Platform Windows `
2074
2063
- UseBuiltCompilers C, Swift `
2075
2064
- SwiftSDK (Get-HostSwiftSDK ) `
2076
- - BuildTargets default `
2077
2065
- Defines @ {
2078
2066
BUILD_SHARED_LIBS = " YES" ;
2079
2067
SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
@@ -2099,7 +2087,7 @@ function Build-LLBuild($Arch, [switch]$Test = $false) {
2099
2087
$env: CLANG = ([IO.Path ]::Combine((Get-HostProjectBinaryCache Compilers), " bin" , " clang.exe" ))
2100
2088
$InstallPath = " "
2101
2089
} else {
2102
- $Targets = @ (" default " )
2090
+ $Targets = @ ()
2103
2091
$TestingDefines = @ {}
2104
2092
$InstallPath = " $ ( $Arch.ToolchainInstallRoot ) \usr"
2105
2093
}
@@ -2147,7 +2135,6 @@ function Build-ArgumentParser($Arch) {
2147
2135
- Platform Windows `
2148
2136
- UseBuiltCompilers Swift `
2149
2137
- SwiftSDK (Get-HostSwiftSDK ) `
2150
- - BuildTargets default `
2151
2138
- Defines @ {
2152
2139
BUILD_SHARED_LIBS = " YES" ;
2153
2140
BUILD_TESTING = " NO" ;
@@ -2163,7 +2150,6 @@ function Build-Driver($Arch) {
2163
2150
- Platform Windows `
2164
2151
- UseBuiltCompilers C, CXX, Swift `
2165
2152
- SwiftSDK (Get-HostSwiftSDK ) `
2166
- - BuildTargets default `
2167
2153
- Defines @ {
2168
2154
BUILD_SHARED_LIBS = " YES" ;
2169
2155
SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
@@ -2203,7 +2189,6 @@ function Build-Collections($Arch) {
2203
2189
- Platform Windows `
2204
2190
- UseBuiltCompilers C, Swift `
2205
2191
- SwiftSDK (Get-HostSwiftSDK ) `
2206
- - BuildTargets default `
2207
2192
- Defines @ {
2208
2193
BUILD_SHARED_LIBS = " YES" ;
2209
2194
}
@@ -2253,7 +2238,6 @@ function Build-PackageManager($Arch) {
2253
2238
- Platform Windows `
2254
2239
- UseBuiltCompilers C, Swift `
2255
2240
- SwiftSDK (Get-HostSwiftSDK ) `
2256
- - BuildTargets default `
2257
2241
- Defines @ {
2258
2242
BUILD_SHARED_LIBS = " YES" ;
2259
2243
CMAKE_Swift_FLAGS = @ (" -DCRYPTO_v2" );
@@ -2281,7 +2265,6 @@ function Build-Markdown($Arch) {
2281
2265
- Platform Windows `
2282
2266
- UseBuiltCompilers C, Swift `
2283
2267
- SwiftSDK (Get-HostSwiftSDK ) `
2284
- - BuildTargets default `
2285
2268
- Defines @ {
2286
2269
BUILD_SHARED_LIBS = " NO" ;
2287
2270
ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
@@ -2299,7 +2282,6 @@ function Build-Format($Arch) {
2299
2282
- UseMSVCCompilers C `
2300
2283
- UseBuiltCompilers Swift `
2301
2284
- SwiftSDK (Get-HostSwiftSDK ) `
2302
- - BuildTargets default `
2303
2285
- Defines @ {
2304
2286
BUILD_SHARED_LIBS = " YES" ;
2305
2287
ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
@@ -2336,7 +2318,6 @@ function Build-SourceKitLSP($Arch) {
2336
2318
- Platform Windows `
2337
2319
- UseBuiltCompilers C, Swift `
2338
2320
- SwiftSDK (Get-HostSwiftSDK ) `
2339
- - BuildTargets default `
2340
2321
- Defines @ {
2341
2322
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2342
2323
SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
@@ -2379,8 +2360,10 @@ function Build-TestingMacros() {
2379
2360
}
2380
2361
2381
2362
$InstallDir = $null
2363
+ $Targets = @ (" default" )
2382
2364
if (-not $Build ) {
2383
2365
$InstallDir = " $ ( $Arch.ToolchainInstallRoot ) \usr"
2366
+ $Targets = @ ()
2384
2367
}
2385
2368
2386
2369
$SwiftSyntaxCMakeModules = if ($Build -and $HostArch -ne $BuildArch ) {
@@ -2397,7 +2380,7 @@ function Build-TestingMacros() {
2397
2380
- Platform $Platform `
2398
2381
- UseBuiltCompilers Swift `
2399
2382
- SwiftSDK:$SwiftSDK `
2400
- - BuildTargets $Targets `
2383
+ - BuildTargets: $Targets `
2401
2384
- Defines @ {
2402
2385
SwiftSyntax_DIR = $SwiftSyntaxCMakeModules ;
2403
2386
}
0 commit comments