@@ -409,7 +409,6 @@ $cmake = Get-CMake
409409$ninja = Get-Ninja
410410
411411$NugetRoot = " $BinaryCache \nuget"
412- $LibraryRoot = " $ImageRoot \Library"
413412
414413# # Select and prepare build tools, platforms, parameters, etc.
415414
@@ -1632,7 +1631,7 @@ function Build-CMark([Hashtable] $Platform) {
16321631 Build-CMakeProject `
16331632 - Src $SourceCache \cmark `
16341633 - Bin (Get-CMarkBinaryCache $Platform ) `
1635- - InstallTo " $ ( $Platform.ToolchainInstallRoot ) \usr" `
1634+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr" `
16361635 - Platform $Platform `
16371636 - Defines @ {
16381637 BUILD_SHARED_LIBS = " YES" ;
@@ -1675,7 +1674,7 @@ function Build-BuildTools([Hashtable] $Platform) {
16751674 SWIFT_INCLUDE_APINOTES = " NO" ;
16761675 SWIFT_INCLUDE_DOCS = " NO" ;
16771676 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" ;
16791678 }
16801679}
16811680
@@ -1749,7 +1748,7 @@ function Get-CompilersDefines([Hashtable] $Platform, [switch] $Test) {
17491748 CLANG_TIDY_CONFUSABLE_CHARS_GEN = (Join-Path - Path $BuildTools - ChildPath " clang-tidy-confusable-chars-gen.exe" );
17501749 CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
17511750 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" ;
17531752 LLDB_PYTHON_EXE_RELATIVE_PATH = " python.exe" ;
17541753 LLDB_PYTHON_EXT_SUFFIX = " .pyd" ;
17551754 LLDB_PYTHON_RELATIVE_PATH = " lib/site-packages" ;
@@ -1791,7 +1790,7 @@ function Build-Compilers([Hashtable] $Platform) {
17911790 Build-CMakeProject `
17921791 - Src $SourceCache \llvm- project\llvm `
17931792 - Bin (Get-ProjectBinaryCache $Platform Compilers) `
1794- - InstallTo " $ ( $Platform.ToolchainInstallRoot ) \usr" `
1793+ - InstallTo " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr" `
17951794 - Platform $Platform `
17961795 - UseMSVCCompilers C, CXX `
17971796 - UsePinnedCompilers Swift `
@@ -2004,36 +2003,28 @@ function Build-Sanitizers([Hashtable] $Platform) {
20042003}
20052004
20062005function Build-ZLib ([Hashtable ] $Platform ) {
2007- $ArchName = $Platform.Architecture.LLVMName
2008-
20092006 Build-CMakeProject `
20102007 - 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" `
20132010 - Platform $Platform `
20142011 - UseMSVCCompilers C `
20152012 - Defines @ {
20162013 BUILD_SHARED_LIBS = " NO" ;
20172014 CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
20182015 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 " ;
20212016 }
20222017}
20232018
20242019function Build-XML2 ([Hashtable ] $Platform ) {
2025- $ArchName = $Platform.Architecture.LLVMName
2026-
20272020 Build-CMakeProject `
20282021 - Src $SourceCache \libxml2 `
20292022 - 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" `
20312024 - Platform $Platform `
20322025 - UseMSVCCompilers C, CXX `
20332026 - Defines @ {
20342027 BUILD_SHARED_LIBS = " NO" ;
2035- CMAKE_INSTALL_BINDIR = " bin/$ ( $Platform.OS.ToString ()) /$ArchName " ;
2036- CMAKE_INSTALL_LIBDIR = " lib/$ ( $Platform.OS.ToString ()) /$ArchName " ;
20372028 CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
20382029 CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
20392030 LIBXML2_WITH_ICONV = " NO" ;
@@ -2075,8 +2066,6 @@ function Build-DS2([Hashtable] $Platform) {
20752066}
20762067
20772068function Build-CURL ([Hashtable ] $Platform ) {
2078- $ArchName = $Platform.Architecture.LLVMName
2079-
20802069 $PlatformDefines = @ {}
20812070 if ($Platform.OS -eq [OS ]::Android) {
20822071 $PlatformDefines += @ {
@@ -2086,14 +2075,13 @@ function Build-CURL([Hashtable] $Platform) {
20862075
20872076 Build-CMakeProject `
20882077 - 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" `
20912080 - Platform $Platform `
20922081 - UseMSVCCompilers C `
20932082 - Defines ($PlatformDefines + @ {
20942083 BUILD_SHARED_LIBS = " NO" ;
20952084 BUILD_TESTING = " NO" ;
2096- CMAKE_INSTALL_LIBDIR = " lib/$ ( $Platform.OS.ToString ()) /$ArchName " ;
20972085 CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
20982086 CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
20992087 BUILD_CURL_EXE = " NO" ;
@@ -2178,8 +2166,8 @@ function Build-CURL([Hashtable] $Platform) {
21782166 USE_WIN32_IDN = if ($Platform.OS -eq [OS ]::Windows) { " YES" } else { " NO" };
21792167 USE_WIN32_LARGE_FILES = if ($Platform.OS -eq [OS ]::Windows) { " YES" } else { " NO" };
21802168 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" ;
21832171 })
21842172}
21852173
@@ -2403,14 +2391,14 @@ function Build-Foundation {
24032391 CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
24042392 ENABLE_TESTING = " NO" ;
24052393 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" ;
24082396 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"
24102398 } 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"
24122400 };
2413- ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1 \usr\include" ;
2401+ ZLIB_INCLUDE_DIR = " $ ( Get-InstallDir $Platform ) \Toolchains\ $ProductVersion + $Variant \usr\include" ;
24142402 dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
24152403 SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
24162404 _SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
@@ -2430,11 +2418,11 @@ function Test-Foundation {
24302418
24312419 Invoke-IsolatingEnvVars {
24322420 $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"
24382426 Build-SPMProject `
24392427 - Action Test `
24402428 - Src $SourceCache \swift- corelibs- foundation `
@@ -2600,8 +2588,8 @@ function Build-ExperimentalSDK([Hashtable] $Platform) {
26002588function Build-SQLite ([Hashtable ] $Platform ) {
26012589 Build-CMakeProject `
26022590 - 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" `
26052593 - Platform $Platform `
26062594 - UseMSVCCompilers C `
26072595 - Defines @ {
@@ -2643,8 +2631,8 @@ function Build-Build([Hashtable] $Platform) {
26432631 SwiftDriver_DIR = (Get-ProjectCMakeModules $Platform Driver);
26442632 SwiftSystem_DIR = (Get-ProjectCMakeModules $Platform System);
26452633 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" ;
26482636 } + $ArchSpecificOptions )
26492637}
26502638
@@ -2674,8 +2662,8 @@ function Build-LLBuild([Hashtable] $Platform) {
26742662 - Defines @ {
26752663 BUILD_SHARED_LIBS = " YES" ;
26762664 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" ;
26792667 }
26802668}
26812669
@@ -2704,8 +2692,8 @@ function Test-LLBuild {
27042692 FILECHECK_EXECUTABLE = ([IO.Path ]::Combine((Get-ProjectBinaryCache $BuildPlatform BuildTools), " bin" , " FileCheck.exe" ));
27052693 LIT_EXECUTABLE = " $SourceCache \llvm-project\llvm\utils\lit\lit.py" ;
27062694 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" ;
27092697 }
27102698 }
27112699}
@@ -2739,8 +2727,8 @@ function Build-Driver([Hashtable] $Platform) {
27392727 TSC_DIR = (Get-ProjectCMakeModules $Platform ToolsSupportCore);
27402728 LLBuild_DIR = (Get-ProjectCMakeModules $Platform LLBuild);
27412729 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" ;
27442732 SWIFT_DRIVER_BUILD_TOOLS = " YES" ;
27452733 LLVM_DIR = " $ ( Get-ProjectBinaryCache $Platform Compilers) \lib\cmake\llvm" ;
27462734 Clang_DIR = " $ ( Get-ProjectBinaryCache $Platform Compilers) \lib\cmake\clang" ;
@@ -2834,8 +2822,8 @@ function Build-PackageManager([Hashtable] $Platform) {
28342822 SwiftASN1_DIR = (Get-ProjectCMakeModules $Platform ASN1);
28352823 SwiftCertificates_DIR = (Get-ProjectCMakeModules $Platform Certificates);
28362824 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" ;
28392827 }
28402828}
28412829
@@ -3130,7 +3118,8 @@ function Test-PackageManager() {
31303118 - Src $SrcDir `
31313119 - Bin " $BinaryCache \$ ( $HostPlatform.Triple ) \PackageManagerTests" `
31323120 - 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"
31343123}
31353124
31363125function Build-Installer ([Hashtable ] $Platform ) {
0 commit comments