@@ -432,6 +432,7 @@ enum TargetComponent {
432
432
Testing
433
433
ClangBuiltins
434
434
ClangRuntime
435
+ SwiftInspect
435
436
}
436
437
437
438
function Get-TargetProjectBinaryCache ($Arch , [TargetComponent ]$Project ) {
@@ -459,7 +460,6 @@ enum HostComponent {
459
460
SourceKitLSP
460
461
SymbolKit
461
462
DocC
462
- SwiftInspect
463
463
}
464
464
465
465
function Get-HostProjectBinaryCache ([HostComponent ]$Project ) {
@@ -2874,19 +2874,37 @@ function Install-HostToolchain() {
2874
2874
Copy-Item - Force $SwiftDriver " $ ( $HostArch.ToolchainInstallRoot ) \usr\bin\swiftc.exe"
2875
2875
}
2876
2876
2877
- function Build-Inspect () {
2878
- $SDKRoot = Get-HostSwiftSDK
2877
+ function Build-Inspect ([Platform ]$Platform , $Arch ) {
2878
+ $InstallPath = if ($Arch -eq $HostArch ) {
2879
+ # Place the host swift-inspect binary with the other toolchain binaries.
2880
+ " $ ( $HostArch.ToolchainInstallRoot ) \usr"
2881
+ } else {
2882
+ " $ ( $Arch.PlatformInstallRoot ) \Developer\Library\$ ( Get-ModuleTriple $Arch ) "
2883
+ }
2884
+
2885
+ $ArgumentParserDir = if ($Platform -eq " Android" ) {
2886
+ # TODO: remove this special-case when the toolchain build moves to a newer version of
2887
+ # swift-argument-parser (>= 1.5.0). For now, let CMake fetch the dependency because
2888
+ # older versions of swift-argument-parser do not build properly for Android.
2889
+ " "
2890
+ } else {
2891
+ Get-HostProjectCMakeModules ArgumentParser
2892
+ }
2879
2893
2880
2894
Build-CMakeProject `
2881
2895
- Src $SourceCache \swift\tools\swift- inspect `
2882
- - Bin (Get-HostProjectBinaryCache SwiftInspect) `
2883
- - InstallTo " $ ( $HostArch.ToolchainInstallRoot ) \usr" `
2884
- - Arch $HostArch `
2896
+ - Bin (Get-TargetProjectBinaryCache $Arch SwiftInspect)`
2897
+ - InstallTo $InstallPath `
2898
+ - Arch $Arch `
2899
+ - Platform $Platform `
2885
2900
- UseBuiltCompilers C, CXX, Swift `
2886
- - SwiftSDK $SDKRoot `
2901
+ - SwiftSDK $Arch .SDKInstallRoot `
2887
2902
- Defines @ {
2888
- CMAKE_Swift_FLAGS = @ (" -Xcc" , " -I$SDKRoot \usr\include\swift\SwiftRemoteMirror" );
2889
- ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
2903
+ CMAKE_Swift_FLAGS = @ (
2904
+ " -Xcc" , " -I$ ( $Arch.SDKInstallRoot ) \usr\lib\swift" ,
2905
+ " -Xcc" , " -I$ ( $Arch.SDKInstallRoot ) \usr\include\swift\SwiftRemoteMirror" ,
2906
+ " -L$ ( $Arch.SDKInstallRoot ) \usr\lib\swift\$Platform " );
2907
+ ArgumentParser_DIR = $ArgumentParserDir ;
2890
2908
}
2891
2909
}
2892
2910
@@ -3033,6 +3051,13 @@ if (-not $SkipBuild) {
3033
3051
Invoke-BuildStep Build-Sanitizers Windows $Arch
3034
3052
Invoke-BuildStep Build-XCTest Windows $Arch
3035
3053
Invoke-BuildStep Build-Testing Windows $Arch
3054
+
3055
+ # Windows swift-inspect only supports 64-bit platforms.
3056
+ if ($Arch.VSName -eq " amd64" -or
3057
+ $Arch.VSName -eq " arm64" ) {
3058
+ Invoke-BuildStep Build-Inspect - Platform Windows - Arch $Arch
3059
+ }
3060
+
3036
3061
Invoke-BuildStep Write-SDKSettingsPlist Windows $Arch
3037
3062
Invoke-BuildStep Write-PlatformInfoPlist $Arch
3038
3063
}
@@ -3053,6 +3078,13 @@ if (-not $SkipBuild) {
3053
3078
Invoke-BuildStep Build-Sanitizers Android $Arch
3054
3079
Invoke-BuildStep Build-XCTest Android $Arch
3055
3080
Invoke-BuildStep Build-Testing Android $Arch
3081
+
3082
+ # Android swift-inspect only supports 64-bit platforms.
3083
+ if ($Arch.AndroidArchABI -eq " arm64-v8a" -or
3084
+ $Arch.AndroidArchABI -eq " x86_64" ) {
3085
+ Invoke-BuildStep Build-Inspect - Platform Android - Arch $Arch
3086
+ }
3087
+
3056
3088
Invoke-BuildStep Write-SDKSettingsPlist Android $Arch
3057
3089
Invoke-BuildStep Write-PlatformInfoPlist $Arch
3058
3090
}
@@ -3099,7 +3131,6 @@ if (-not $SkipBuild) {
3099
3131
Invoke-BuildStep Build-LMDB $HostArch
3100
3132
Invoke-BuildStep Build-IndexStoreDB $HostArch
3101
3133
Invoke-BuildStep Build-SourceKitLSP $HostArch
3102
- Invoke-BuildStep Build-Inspect $HostArch
3103
3134
}
3104
3135
3105
3136
Install-HostToolchain
0 commit comments