@@ -674,6 +674,7 @@ function Invoke-BuildStep {
674
674
enum Project {
675
675
BuildTools
676
676
RegsGen2
677
+ EarlySwiftDriver
677
678
678
679
Compilers
679
680
FoundationMacros
@@ -1203,10 +1204,10 @@ function Get-PinnedToolchainToolsDir() {
1203
1204
" unknown-Asserts-development.xctoolchain" , " usr" , " bin" )
1204
1205
}
1205
1206
1206
- function Get-PinnedToolchainSDK () {
1207
+ function Get-PinnedToolchainSDK ([ OS ] $OS = $BuildPlatform .OS , [ string ] $Identifier = $OS .ToString () ) {
1207
1208
return [IO.Path ]::Combine(" $BinaryCache \" , " toolchains" , $PinnedToolchain ,
1208
1209
" LocalApp" , " Programs" , " Swift" , " Platforms" , (Get-PinnedToolchainVersion ),
1209
- " Windows. platform" , " Developer" , " SDKs" , " Windows .sdk" )
1210
+ " $ ( $OS .ToString () ) . platform" , " Developer" , " SDKs" , " $Identifier .sdk" )
1210
1211
}
1211
1212
1212
1213
function Get-PinnedToolchainRuntime () {
@@ -1469,7 +1470,7 @@ function Build-CMakeProject {
1469
1470
1470
1471
} else {
1471
1472
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_TARGET $Platform.Triple
1472
- $SwiftArgs += @ (" -sdk" , ( Get-PinnedToolchainSDK ))
1473
+ $SwiftArgs += @ (" -sdk" , $ ( if ( $SwiftSDK ) { $SwiftSDK } else { Get-PinnedToolchainSDK } ))
1473
1474
}
1474
1475
1475
1476
# Debug Information
@@ -1754,6 +1755,26 @@ function Build-BuildTools([Hashtable] $Platform) {
1754
1755
}
1755
1756
}
1756
1757
1758
+ function Build-EarlySwiftDriver {
1759
+ Build-CMakeProject `
1760
+ - Src $SourceCache \swift- driver `
1761
+ - Bin (Get-ProjectBinaryCache $Platform EarlySwiftDriver) `
1762
+ - Platform $BuildPlatform `
1763
+ - UsePinnedCompilers C, CXX, Swift `
1764
+ - SwiftSDK (Get-PinnedToolchainSDK - OS $BuildPlatform.OS - Identifier " $ ( $BuildPlatform.OS ) Experimental" ) `
1765
+ - BuildTargets default `
1766
+ - Defines @ {
1767
+ BUILD_SHARED_LIBS = " NO" ;
1768
+ BUILD_TESTING = " NO" ;
1769
+ CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
1770
+ # TODO(compnerd) - enforce dynamic BlocksRuntime and dispatch
1771
+ CMAKE_Swift_FLAGS = @ (" -static-stdlib" , " -Xfrontend" , " -use-static-resource-dir" , " -Xcc" , " -static-libclosure" , " -Xcc" , " -Ddispatch_STATIC" );
1772
+ SWIFT_DRIVER_BUILD_TOOLS = " NO" ;
1773
+ SQLite3_INCLUDE_DIR = " $SourceCache \swift-toolchain-sqlite\Sources\CSQLite\include" ;
1774
+ SQLite3_LIBRARY = " $ ( Get-ProjectBinaryCache $Platform SQLite) \SQLite3.lib" ;
1775
+ }
1776
+ }
1777
+
1757
1778
function Write-PList {
1758
1779
[CmdletBinding (PositionalBinding = $false )]
1759
1780
param
@@ -1823,6 +1844,7 @@ function Get-CompilersDefines([Hashtable] $Platform, [string] $Variant, [switch]
1823
1844
CLANG_TABLEGEN = (Join-Path - Path $BuildTools - ChildPath " clang-tblgen.exe" );
1824
1845
CLANG_TIDY_CONFUSABLE_CHARS_GEN = (Join-Path - Path $BuildTools - ChildPath " clang-tidy-confusable-chars-gen.exe" );
1825
1846
CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
1847
+ CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
1826
1848
CMAKE_Swift_FLAGS = $SwiftFlags ;
1827
1849
LibXml2_DIR = " $BinaryCache \$ ( $Platform.Triple ) \usr\lib\cmake\libxml2-2.11.5" ;
1828
1850
LLDB_LIBXML2_VERSION = " 2.11.5" ;
@@ -3429,6 +3451,8 @@ if (-not $SkipBuild) {
3429
3451
3430
3452
Invoke-BuildStep Build-CMark $BuildPlatform
3431
3453
Invoke-BuildStep Build-BuildTools $BuildPlatform
3454
+ Invoke-BuildStep Build-SQLite $BuildPlatform
3455
+ Invoke-BuildStep Build-EarlySwiftDriver $BuildPlatform
3432
3456
if ($IsCrossCompiling ) {
3433
3457
Invoke-BuildStep Build-XML2 $BuildPlatform
3434
3458
Invoke-BuildStep Build-Compilers $BuildPlatform - Variant " Asserts"
0 commit comments