Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ function Get-CompilersDefines([Hashtable] $Platform, [string] $Variant, [switch]
SWIFT_ENABLE_VOLATILE = "YES";
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = "$SourceCache\swift-corelibs-libdispatch";
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = "$SourceCache\swift-experimental-string-processing";
SWIFT_PATH_TO_SWIFT_SDK = (Get-PinnedToolchainSDK);
SWIFT_PATH_TO_SWIFT_SDK = (Get-PinnedToolchainSDK -OS $Platform.OS);
SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE = "$SourceCache\swift-syntax";
SWIFT_STDLIB_ASSERTIONS = "NO";
SWIFTSYNTAX_ENABLE_ASSERTIONS = "NO";
Expand All @@ -2139,7 +2139,7 @@ function Build-Compilers([Hashtable] $Platform, [string] $Variant) {
-Platform $Platform `
-UseMSVCCompilers $(if ($UseHostToolchain) { @("C", "CXX") } else { @("") }) `
-UsePinnedCompilers $(if ($UseHostToolchain) { @("Swift") } else { @("C", "CXX", "Swift") }) `
-SwiftSDK (Get-PinnedToolchainSDK) `
-SwiftSDK (Get-PinnedToolchainSDK -OS $Platform.OS) `
-BuildTargets @("install-distribution") `
-CacheScript $SourceCache\swift\cmake\caches\Windows-$($Platform.Architecture.LLVMName).cmake `
-Defines (Get-CompilersDefines $Platform $Variant)
Expand Down Expand Up @@ -2207,7 +2207,7 @@ function Test-Compilers([Hashtable] $Platform, [string] $Variant, [switch] $Test
-Platform $Platform `
-UseMSVCCompilers $(if ($UseHostToolchain) { @("C", "CXX") } else { @("") }) `
-UsePinnedCompilers $(if ($UseHostToolchain) { @("Swift") } else { @("C", "CXX", "Swift") }) `
-SwiftSDK (Get-PinnedToolchainSDK) `
-SwiftSDK (Get-PinnedToolchainSDK -OS $Platform.OS) `
-BuildTargets $Targets `
-CacheScript $SourceCache\swift\cmake\caches\Windows-$($Platform.Architecture.LLVMName).cmake `
-Defines $TestingDefines
Expand Down Expand Up @@ -3602,6 +3602,7 @@ function Build-LMDB([Hashtable] $Platform) {
}

function Build-IndexStoreDB([Hashtable] $Platform) {
$SDKROOT = Get-SwiftSDK $Platform.OS
Build-CMakeProject `
-Src $SourceCache\indexstore-db `
-Bin (Get-ProjectBinaryCache $Platform IndexStoreDB) `
Expand All @@ -3612,8 +3613,8 @@ function Build-IndexStoreDB([Hashtable] $Platform) {
-Defines @{
BUILD_SHARED_LIBS = "NO";
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
CMAKE_C_FLAGS = @("-I$(Get-SwiftSDK $Platform.OS)\usr\include", "-I$(Get-SwiftSDK $Platform.OS)\usr\include\Block");
CMAKE_CXX_FLAGS = @("-I$(Get-SwiftSDK $Platform.OS)\usr\include", "-I$(Get-SwiftSDK $Platform.OS)\usr\include\Block");
CMAKE_C_FLAGS = @("-I$SDKROOT\usr\include", "-I$SDKROOT\usr\include\Block");
CMAKE_CXX_FLAGS = @("-I$SDKROOT\usr\include", "-I$SDKROOT\usr\include\Block");
LMDB_DIR = (Get-ProjectCMakeModules $Platform LMDB);
}
}
Expand Down Expand Up @@ -3781,6 +3782,8 @@ function Build-Inspect([Hashtable] $Platform) {
$InstallPath = "$(Get-PlatformRoot $Platform.OS)\Developer\Library\$(Get-ModuleTriple $Platform)"
}

$SDKROOT = Get-SwiftSDK $Platform.OS

Build-CMakeProject `
-Src $SourceCache\swift\tools\swift-inspect `
-Bin (Get-ProjectBinaryCache $Platform SwiftInspect)`
Expand All @@ -3790,10 +3793,10 @@ function Build-Inspect([Hashtable] $Platform) {
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
-Defines @{
CMAKE_Swift_FLAGS = @(
"-Xcc", "-I$(Get-SwiftSDK $Platform.OS)\usr\include",
"-Xcc", "-I$(Get-SwiftSDK $Platform.OS)\usr\lib\swift",
"-Xcc", "-I$(Get-SwiftSDK $Platform.OS)\usr\include\swift\SwiftRemoteMirror",
"-L$(Get-SwiftSDK $Platform.OS)\usr\lib\swift\$($Platform.OS.ToString())\$($Platform.Architecture.LLVMName)"
"-Xcc", "-I$SDKROOT\usr\include",
"-Xcc", "-I$SDKROOT\usr\lib\swift",
"-Xcc", "-I$SDKROOT\usr\include\swift\SwiftRemoteMirror",
"-L$SDKROOT\usr\lib\swift\$($Platform.OS.ToString())\$($Platform.Architecture.LLVMName)"
);
ArgumentParser_DIR = $ArgumentParserDir;
}
Expand Down