Skip to content

Commit 84f3e44

Browse files
committed
utils: add the rules to build swift-build
Add a smoke test build of swift-build. While this is not integrated into SPM, it allows us to ensure that swift-build is able to be built with the just built compiler on Windows.
1 parent bb65b08 commit 84f3e44

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

utils/build.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ enum HostComponent {
455455
ASN1
456456
Certificates
457457
System
458+
Build
458459
PackageManager
459460
Markdown
460461
Format
@@ -2536,6 +2537,28 @@ function Build-System($Arch) {
25362537
}
25372538
}
25382539

2540+
function Build-Build($Arch) {
2541+
Build-CMakeProject `
2542+
-Src $SourceCache\swift-build `
2543+
-Bin (Get-HostProjectBinaryCache Build) `
2544+
-InstallTo "$($Arch.ToolchainInstallRoot)\usr" `
2545+
-Arch $Arch `
2546+
-Platform Windows `
2547+
-UseBuiltCompilers C,CXX,Swift `
2548+
-SwiftSDK (Get-HostSwiftSDK) `
2549+
-Defines @{
2550+
BUILD_SHARED_LIBS = "YES";
2551+
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
2552+
ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
2553+
LLBuild_DIR = (Get-HostProjectCMakeModules LLBuild);
2554+
SwiftDriver_DIR = (Get-HostProjectCMakeModules Driver);
2555+
SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
2556+
TSC_DIR = (Get-HostProjectCMakeModules ToolsSupportCore);
2557+
SQLite3_INCLUDE_DIR = "$LibraryRoot\sqlite-3.46.0\usr\include";
2558+
SQLite3_LIBRARY = "$LibraryRoot\sqlite-3.46.0\usr\lib\SQLite3.lib";
2559+
}
2560+
}
2561+
25392562
function Build-ToolsSupportCore($Arch) {
25402563
Build-CMakeProject `
25412564
-Src $SourceCache\swift-tools-support-core `
@@ -3262,6 +3285,7 @@ if (-not $SkipBuild) {
32623285
Invoke-BuildStep Build-ASN1 $HostArch
32633286
Invoke-BuildStep Build-Certificates $HostArch
32643287
Invoke-BuildStep Build-System $HostArch
3288+
Invoke-BuildStep Build-Build $HostArch
32653289
Invoke-BuildStep Build-PackageManager $HostArch
32663290
Invoke-BuildStep Build-Markdown $HostArch
32673291
Invoke-BuildStep Build-Format $HostArch

0 commit comments

Comments
 (0)