@@ -2875,20 +2875,17 @@ function Install-HostToolchain() {
28752875}
28762876
28772877function 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- " "
2878+ if ($Arch -eq $HostArch ) {
2879+ # When building for the host target, use the host version of the swift-argument-parser,
2880+ # and place the host swift-inspect executable with the other host toolchain binaries.
2881+ $ArgumentParserDir = Get-HostProjectCMakeModules ArgumentParser
2882+ $InstallPath = " $ ( $HostArch.ToolchainInstallRoot ) \usr"
28902883 } else {
2891- Get-HostProjectCMakeModules ArgumentParser
2884+ # When building for non-host target, let CMake fetch the swift-argument-parser dependency
2885+ # since it is currently only built for the host and and cannot be built for Android until
2886+ # the pinned version is >= 1.5.0.
2887+ $ArgumentParserDir = " "
2888+ $InstallPath = " $ ( $Arch.PlatformInstallRoot ) \Developer\Library\$ ( Get-ModuleTriple $Arch ) "
28922889 }
28932890
28942891 Build-CMakeProject `
@@ -3051,13 +3048,6 @@ if (-not $SkipBuild) {
30513048 Invoke-BuildStep Build-Sanitizers Windows $Arch
30523049 Invoke-BuildStep Build-XCTest Windows $Arch
30533050 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-
30613051 Invoke-BuildStep Write-SDKSettingsPlist Windows $Arch
30623052 Invoke-BuildStep Write-PlatformInfoPlist $Arch
30633053 }
@@ -3084,7 +3074,6 @@ if (-not $SkipBuild) {
30843074 $Arch.AndroidArchABI -eq " x86_64" ) {
30853075 Invoke-BuildStep Build-Inspect - Platform Android - Arch $Arch
30863076 }
3087-
30883077 Invoke-BuildStep Write-SDKSettingsPlist Android $Arch
30893078 Invoke-BuildStep Write-PlatformInfoPlist $Arch
30903079 }
@@ -3131,6 +3120,7 @@ if (-not $SkipBuild) {
31313120 Invoke-BuildStep Build-LMDB $HostArch
31323121 Invoke-BuildStep Build-IndexStoreDB $HostArch
31333122 Invoke-BuildStep Build-SourceKitLSP $HostArch
3123+ Invoke-BuildStep Build-Inspect Windows $HostArch
31343124}
31353125
31363126Install-HostToolchain
0 commit comments