@@ -409,7 +409,6 @@ $cmake = Get-CMake
409
409
$ninja = Get-Ninja
410
410
411
411
$NugetRoot = " $BinaryCache \nuget"
412
- $LibraryRoot = " $ImageRoot \Library"
413
412
414
413
# # Select and prepare build tools, platforms, parameters, etc.
415
414
@@ -1632,7 +1631,7 @@ function Build-CMark([Hashtable] $Platform) {
1632
1631
Build-CMakeProject `
1633
1632
- Src $SourceCache \cmark `
1634
1633
- Bin (Get-CMarkBinaryCache $Platform ) `
1635
- - InstallTo " $ ( $Platform.ToolchainInstallRoot ) \usr" `
1634
+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr" `
1636
1635
- Platform $Platform `
1637
1636
- Defines @ {
1638
1637
BUILD_SHARED_LIBS = " YES" ;
@@ -1675,7 +1674,7 @@ function Build-BuildTools([Hashtable] $Platform) {
1675
1674
SWIFT_INCLUDE_APINOTES = " NO" ;
1676
1675
SWIFT_INCLUDE_DOCS = " NO" ;
1677
1676
SWIFT_INCLUDE_TESTS = " NO" ;
1678
- " cmark-gfm_DIR" = " $ ( $Platform.ToolchainInstallRoot ) \usr\lib\cmake" ;
1677
+ " cmark-gfm_DIR" = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\lib\cmake" ;
1679
1678
}
1680
1679
}
1681
1680
@@ -1749,7 +1748,7 @@ function Get-CompilersDefines([Hashtable] $Platform, [switch] $Test) {
1749
1748
CLANG_TIDY_CONFUSABLE_CHARS_GEN = (Join-Path - Path $BuildTools - ChildPath " clang-tidy-confusable-chars-gen.exe" );
1750
1749
CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
1751
1750
CMAKE_Swift_FLAGS = $SwiftFlags ;
1752
- LibXml2_DIR = " $LibraryRoot \libxml2-2.11.5\usr\lib\Windows\ $ ( $Platform .Architecture.LLVMName ) \cmake\libxml2-2.11.5" ;
1751
+ LibXml2_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\lib \cmake\libxml2-2.11.5" ;
1753
1752
LLDB_PYTHON_EXE_RELATIVE_PATH = " python.exe" ;
1754
1753
LLDB_PYTHON_EXT_SUFFIX = " .pyd" ;
1755
1754
LLDB_PYTHON_RELATIVE_PATH = " lib/site-packages" ;
@@ -1791,7 +1790,7 @@ function Build-Compilers([Hashtable] $Platform) {
1791
1790
Build-CMakeProject `
1792
1791
- Src $SourceCache \llvm- project\llvm `
1793
1792
- Bin (Get-ProjectBinaryCache $Platform Compilers) `
1794
- - InstallTo " $ ( $Platform.ToolchainInstallRoot ) \usr" `
1793
+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr" `
1795
1794
- Platform $Platform `
1796
1795
- UseMSVCCompilers C, CXX `
1797
1796
- UsePinnedCompilers Swift `
@@ -2004,36 +2003,28 @@ function Build-Sanitizers([Hashtable] $Platform) {
2004
2003
}
2005
2004
2006
2005
function Build-ZLib ([Hashtable ] $Platform ) {
2007
- $ArchName = $Platform.Architecture.LLVMName
2008
-
2009
2006
Build-CMakeProject `
2010
2007
- Src $SourceCache \zlib `
2011
- - Bin " $BinaryCache \$ ( $Platform.Triple ) \zlib-1.3.1 " `
2012
- - InstallTo $LibraryRoot \zlib - 1.3 . 1 \ usr `
2008
+ - Bin " $BinaryCache \$ ( $Platform.Triple ) \zlib" `
2009
+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \ usr" `
2013
2010
- Platform $Platform `
2014
2011
- UseMSVCCompilers C `
2015
2012
- Defines @ {
2016
2013
BUILD_SHARED_LIBS = " NO" ;
2017
2014
CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
2018
2015
CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2019
- INSTALL_BIN_DIR = " $LibraryRoot \zlib-1.3.1\usr\bin\$ ( $Platform.OS.ToString ()) \$ArchName " ;
2020
- INSTALL_LIB_DIR = " $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName " ;
2021
2016
}
2022
2017
}
2023
2018
2024
2019
function Build-XML2 ([Hashtable ] $Platform ) {
2025
- $ArchName = $Platform.Architecture.LLVMName
2026
-
2027
2020
Build-CMakeProject `
2028
2021
- Src $SourceCache \libxml2 `
2029
2022
- Bin " $BinaryCache \$ ( $Platform.Triple ) \libxml2-2.11.5" `
2030
- - InstallTo " $LibraryRoot \libxml2-2.11.5 \usr" `
2023
+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr" `
2031
2024
- Platform $Platform `
2032
2025
- UseMSVCCompilers C, CXX `
2033
2026
- Defines @ {
2034
2027
BUILD_SHARED_LIBS = " NO" ;
2035
- CMAKE_INSTALL_BINDIR = " bin/$ ( $Platform.OS.ToString ()) /$ArchName " ;
2036
- CMAKE_INSTALL_LIBDIR = " lib/$ ( $Platform.OS.ToString ()) /$ArchName " ;
2037
2028
CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
2038
2029
CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2039
2030
LIBXML2_WITH_ICONV = " NO" ;
@@ -2075,8 +2066,6 @@ function Build-DS2([Hashtable] $Platform) {
2075
2066
}
2076
2067
2077
2068
function Build-CURL ([Hashtable ] $Platform ) {
2078
- $ArchName = $Platform.Architecture.LLVMName
2079
-
2080
2069
$PlatformDefines = @ {}
2081
2070
if ($Platform.OS -eq [OS ]::Android) {
2082
2071
$PlatformDefines += @ {
@@ -2086,14 +2075,13 @@ function Build-CURL([Hashtable] $Platform) {
2086
2075
2087
2076
Build-CMakeProject `
2088
2077
- Src $SourceCache \curl `
2089
- - Bin " $BinaryCache \$ ( $Platform.Triple ) \curl-8.9.1 " `
2090
- - InstallTo " $LibraryRoot \curl-8.9.1 \usr" `
2078
+ - Bin " $BinaryCache \$ ( $Platform.Triple ) \curl" `
2079
+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr" `
2091
2080
- Platform $Platform `
2092
2081
- UseMSVCCompilers C `
2093
2082
- Defines ($PlatformDefines + @ {
2094
2083
BUILD_SHARED_LIBS = " NO" ;
2095
2084
BUILD_TESTING = " NO" ;
2096
- CMAKE_INSTALL_LIBDIR = " lib/$ ( $Platform.OS.ToString ()) /$ArchName " ;
2097
2085
CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
2098
2086
CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2099
2087
BUILD_CURL_EXE = " NO" ;
@@ -2178,8 +2166,8 @@ function Build-CURL([Hashtable] $Platform) {
2178
2166
USE_WIN32_IDN = if ($Platform.OS -eq [OS ]::Windows) { " YES" } else { " NO" };
2179
2167
USE_WIN32_LARGE_FILES = if ($Platform.OS -eq [OS ]::Windows) { " YES" } else { " NO" };
2180
2168
USE_WIN32_LDAP = " NO" ;
2181
- ZLIB_ROOT = " $LibraryRoot \zlib-1.3.1 \usr" ;
2182
- ZLIB_LIBRARY = " $LibraryRoot \zlib-1.3.1\usr\lib\ $ ( $ Platform.OS.ToString () ) \ $ArchName \zlibstatic.lib" ;
2169
+ ZLIB_ROOT = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr" ;
2170
+ ZLIB_LIBRARY = " $ ( Get-InstallDir $ Platform) \Toolchains\ $ProductVersion + $Variant \usr\lib \zlibstatic.lib" ;
2183
2171
})
2184
2172
}
2185
2173
@@ -2403,14 +2391,14 @@ function Build-Foundation {
2403
2391
CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2404
2392
ENABLE_TESTING = " NO" ;
2405
2393
FOUNDATION_BUILD_TOOLS = if ($Platform.OS -eq [OS ]::Windows) { " YES" } else { " NO" };
2406
- CURL_DIR = " $LibraryRoot \curl-8.9.1\usr\lib\ $ ( $ Platform.OS.ToString () ) \ $ ( $Platform .Architecture.LLVMName ) \cmake\CURL" ;
2407
- LibXml2_DIR = " $LibraryRoot \libxml2-2.11.5\usr\lib\ $ ( $ Platform.OS.ToString () ) \ $ ( $Platform .Architecture.LLVMName ) \cmake\libxml2-2.11.5" ;
2394
+ CURL_DIR = " $ ( Get-InstallDir $ Platform) \Toolchains\ $ProductVersion + $Variant \usr\lib \cmake\CURL" ;
2395
+ LibXml2_DIR = " $ ( Get-InstallDir $ Platform) \Toolchains\ $ProductVersion + $Variant \usr\lib \cmake\libxml2-2.11.5" ;
2408
2396
ZLIB_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2409
- " $LibraryRoot \zlib-1.3.1\usr\lib\ $ ( $ Platform.OS.ToString () ) \ $ ( $Platform .Architecture.LLVMName ) \zlibstatic.lib"
2397
+ " $ ( Get-InstallDir $ Platform) \Toolchains\ $ProductVersion + $Variant \usr\lib \zlibstatic.lib"
2410
2398
} else {
2411
- " $LibraryRoot \zlib-1.3.1\usr\lib\ $ ( $ Platform.OS.ToString () ) \ $ ( $Platform .Architecture.LLVMName ) \libz.a"
2399
+ " $ ( Get-InstallDir $ Platform) \Toolchains\ $ProductVersion + $Variant \usr\lib \libz.a"
2412
2400
};
2413
- ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1 \usr\include" ;
2401
+ ZLIB_INCLUDE_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\include" ;
2414
2402
dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
2415
2403
SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
2416
2404
_SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
@@ -2430,11 +2418,11 @@ function Test-Foundation {
2430
2418
2431
2419
Invoke-IsolatingEnvVars {
2432
2420
$env: DISPATCH_INCLUDE_PATH = " $ ( Get-SwiftSDK Windows) /usr/include"
2433
- $env: LIBXML_LIBRARY_PATH = " $LibraryRoot /libxml2-2.11.5/usr/lib/windows/ $ ( $BuildPlatform .Architecture.LLVMName ) "
2434
- $env: LIBXML_INCLUDE_PATH = " $LibraryRoot /libxml2-2.11.5 /usr/include/libxml2"
2435
- $env: ZLIB_LIBRARY_PATH = " $LibraryRoot /zlib-1.3.1/usr/lib/windows/ $ ( $BuildPlatform .Architecture.LLVMName ) "
2436
- $env: CURL_LIBRARY_PATH = " $LibraryRoot /curl-8.9.1/usr/lib/windows/ $ ( $BuildPlatform .Architecture.LLVMName ) "
2437
- $env: CURL_INCLUDE_PATH = " $LibraryRoot /curl-8.9.1 /usr/include"
2421
+ $env: LIBXML_LIBRARY_PATH = " $ ( Get-InstallDir $Platform ) /Toolchains/ $ProductVersion + $Variant /usr/lib "
2422
+ $env: LIBXML_INCLUDE_PATH = " $ ( Get-InstallDir $Platform ) /Toolchains/ $ProductVersion + $Variant /usr/include/libxml2"
2423
+ $env: ZLIB_LIBRARY_PATH = " $ ( Get-InstallDir $Platform ) /Toolchains/ $ProductVersion + $Variant /usr/lib "
2424
+ $env: CURL_LIBRARY_PATH = " $ ( Get-InstallDir $Platform ) /Toolchains/ $ProductVersion + $Variant /usr/lib "
2425
+ $env: CURL_INCLUDE_PATH = " $ ( Get-InstallDir $Platform ) /Toolchains/ $ProductVersion + $Variant /usr/include"
2438
2426
Build-SPMProject `
2439
2427
- Action Test `
2440
2428
- Src $SourceCache \swift- corelibs- foundation `
@@ -2600,8 +2588,8 @@ function Build-ExperimentalSDK([Hashtable] $Platform) {
2600
2588
function Build-SQLite ([Hashtable ] $Platform ) {
2601
2589
Build-CMakeProject `
2602
2590
- Src $SourceCache \swift- toolchain- sqlite `
2603
- - Bin " $BinaryCache \$ ( $Platform.Triple ) \sqlite-3.46.0 " `
2604
- - InstallTo $LibraryRoot \sqlite - 3.46 . 0 \ usr `
2591
+ - Bin " $BinaryCache \$ ( $Platform.Triple ) \sqlite" `
2592
+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \ usr" `
2605
2593
- Platform $Platform `
2606
2594
- UseMSVCCompilers C `
2607
2595
- Defines @ {
@@ -2643,8 +2631,8 @@ function Build-Build([Hashtable] $Platform) {
2643
2631
SwiftDriver_DIR = (Get-ProjectCMakeModules $Platform Driver);
2644
2632
SwiftSystem_DIR = (Get-ProjectCMakeModules $Platform System);
2645
2633
TSC_DIR = (Get-ProjectCMakeModules $Platform ToolsSupportCore);
2646
- SQLite3_INCLUDE_DIR = " $LibraryRoot \sqlite-3.46.0 \usr\include" ;
2647
- SQLite3_LIBRARY = " $LibraryRoot \sqlite-3.46.0 \usr\lib\SQLite3.lib" ;
2634
+ SQLite3_INCLUDE_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\include" ;
2635
+ SQLite3_LIBRARY = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\lib\SQLite3.lib" ;
2648
2636
} + $ArchSpecificOptions )
2649
2637
}
2650
2638
@@ -2674,8 +2662,8 @@ function Build-LLBuild([Hashtable] $Platform) {
2674
2662
- Defines @ {
2675
2663
BUILD_SHARED_LIBS = " YES" ;
2676
2664
LLBUILD_SUPPORT_BINDINGS = " Swift" ;
2677
- SQLite3_INCLUDE_DIR = " $LibraryRoot \sqlite-3.46.0 \usr\include" ;
2678
- SQLite3_LIBRARY = " $LibraryRoot \sqlite-3.46.0 \usr\lib\SQLite3.lib" ;
2665
+ SQLite3_INCLUDE_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\include" ;
2666
+ SQLite3_LIBRARY = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\lib\SQLite3.lib" ;
2679
2667
}
2680
2668
}
2681
2669
@@ -2704,8 +2692,8 @@ function Test-LLBuild {
2704
2692
FILECHECK_EXECUTABLE = ([IO.Path ]::Combine((Get-ProjectBinaryCache $BuildPlatform BuildTools), " bin" , " FileCheck.exe" ));
2705
2693
LIT_EXECUTABLE = " $SourceCache \llvm-project\llvm\utils\lit\lit.py" ;
2706
2694
LLBUILD_SUPPORT_BINDINGS = " Swift" ;
2707
- SQLite3_INCLUDE_DIR = " $LibraryRoot \sqlite-3.46.0 \usr\include" ;
2708
- SQLite3_LIBRARY = " $LibraryRoot \sqlite-3.46.0 \usr\lib\SQLite3.lib" ;
2695
+ SQLite3_INCLUDE_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\include" ;
2696
+ SQLite3_LIBRARY = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\lib\SQLite3.lib" ;
2709
2697
}
2710
2698
}
2711
2699
}
@@ -2739,8 +2727,8 @@ function Build-Driver([Hashtable] $Platform) {
2739
2727
TSC_DIR = (Get-ProjectCMakeModules $Platform ToolsSupportCore);
2740
2728
LLBuild_DIR = (Get-ProjectCMakeModules $Platform LLBuild);
2741
2729
ArgumentParser_DIR = (Get-ProjectCMakeModules $Platform ArgumentParser);
2742
- SQLite3_INCLUDE_DIR = " $LibraryRoot \sqlite-3.46.0 \usr\include" ;
2743
- SQLite3_LIBRARY = " $LibraryRoot \sqlite-3.46.0 \usr\lib\SQLite3.lib" ;
2730
+ SQLite3_INCLUDE_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\include" ;
2731
+ SQLite3_LIBRARY = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\lib\SQLite3.lib" ;
2744
2732
SWIFT_DRIVER_BUILD_TOOLS = " YES" ;
2745
2733
LLVM_DIR = " $ ( Get-ProjectBinaryCache $Platform Compilers) \lib\cmake\llvm" ;
2746
2734
Clang_DIR = " $ ( Get-ProjectBinaryCache $Platform Compilers) \lib\cmake\clang" ;
@@ -2834,8 +2822,8 @@ function Build-PackageManager([Hashtable] $Platform) {
2834
2822
SwiftASN1_DIR = (Get-ProjectCMakeModules $Platform ASN1);
2835
2823
SwiftCertificates_DIR = (Get-ProjectCMakeModules $Platform Certificates);
2836
2824
SwiftSyntax_DIR = (Get-ProjectCMakeModules $Platform Compilers);
2837
- SQLite3_INCLUDE_DIR = " $LibraryRoot \sqlite-3.46.0 \usr\include" ;
2838
- SQLite3_LIBRARY = " $LibraryRoot \sqlite-3.46.0 \usr\lib\SQLite3.lib" ;
2825
+ SQLite3_INCLUDE_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\include" ;
2826
+ SQLite3_LIBRARY = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\lib\SQLite3.lib" ;
2839
2827
}
2840
2828
}
2841
2829
@@ -3130,7 +3118,8 @@ function Test-PackageManager() {
3130
3118
- Src $SrcDir `
3131
3119
- Bin " $BinaryCache \$ ( $HostPlatform.Triple ) \PackageManagerTests" `
3132
3120
- Platform $HostPlatform `
3133
- - Xcc " -I$LibraryRoot \sqlite-3.46.0\usr\include" - Xlinker " -L$LibraryRoot \sqlite-3.46.0\usr\lib"
3121
+ - Xcc " -I$ ( Get-InstallDir $Platform ) \Toolchains\$ProductVersion +$Variant \usr\include" `
3122
+ - Xlinker " -L$ ( Get-InstallDir $Platform ) \Toolchains\$ProductVersion +$Variant \usr\lib"
3134
3123
}
3135
3124
3136
3125
function Build-Installer ([Hashtable ] $Platform ) {
0 commit comments