+ Write-Host " Install path: $InstallPath"\r
+\r
+ # What MSVC versions landed, and which host toolchains each one carries.\r
+ # HostARM64 is the directory that proves the native ARM64 compiler is here\r
+ # rather than an x64 one that would run under emulation.\r
+ $msvcRoot = Join-Path $InstallPath 'VC\Tools\MSVC'\r
+ foreach ($v in (Get-ChildItem $msvcRoot -Directory -ErrorAction SilentlyContinue | Sort-Object Name)) {\r
+ $hosts = Get-ChildItem (Join-Path $v.FullName 'bin') -Directory -ErrorAction SilentlyContinue |\r
+ ForEach-Object { $_.Name }\r
+ Write-Host " MSVC $($v.Name): $(if ($hosts) { $hosts -join ', ' } else { '(no bin dir)' })"\r
+ }\r
+ if ($IsArm64) {\r
+ $armHost = Test-Path (Join-Path $msvcRoot '*\bin\HostARM64\ARM64\cl.exe')\r
+ if ($armHost) {\r
+ Write-Host ' OK: native ARM64-hosted cl.exe present.' -ForegroundColor Green\r
+ } else {\r
+ Write-Warning 'No HostARM64 cl.exe found - MSVC would run under x64 emulation. Add "MSVC v14x - VS 2022 C++ ARM64/ARM64EC build tools" in the installer.'\r
+ }\r
+ }\r
+\r
+ # clang-cl, for the ClangCL toolset in CMakePresets.json. Checked per host\r
+ # directory, because the Llvm tree is partitioned by HOST architecture and\r
+ # only the matching one is a native compiler.\r
+ #\r
+ # Look for clang-cl.exe specifically, NOT for the directory. VC\Tools\Llvm\*\bin\r
+ # holds clang-format.exe and clang-tidy.exe on every host whether or not the\r
+ # Clang component was ever installed - those ship with the NativeDesktop\r
+ # workload - so a present ARM64\bin proves nothing on its own. That is the\r
+ # false positive to avoid when checking this by hand.\r
+ $llvmRoot = Join-Path $InstallPath 'VC\Tools\Llvm'\r
+ $clangArm = Test-Path (Join-Path $llvmRoot 'ARM64\bin\clang-cl.exe')\r
+ $clangX64 = Test-Path (Join-Path $llvmRoot 'x64\bin\clang-cl.exe')\r
+ $clangX86 = Test-Path (Join-Path $llvmRoot 'bin\clang-cl.exe')\r
+ if ($clangArm -or $clangX64 -or $clangX86) {\r
+ Write-Host " clang-cl: $(@(if ($clangArm) {'ARM64'}; if ($clangX64) {'x64'}; if ($clangX86) {'x86'}) -join ', ')" -ForegroundColor Green\r
+ # On ARM64 the x64 build would still run, under emulation - so say plainly\r
+ # whether the NATIVE one is the one that landed.\r
+ if ($IsArm64 -and -not $clangArm) {\r
+ Write-Warning 'No ARM64-hosted clang-cl - the x64 one would run under emulation. Re-run the Clang/LLVM pass, or add "C++ Clang tools for Windows" in the installer.'\r
+ }\r
+ } else {\r
+ Write-Warning 'clang-cl not found - the ClangCL presets will fail. Add the "C++ Clang tools for Windows" component.'\r
+ }\r
+\r
+ # v141 / XP. Only meaningful where the toolset can exist at all; on ARM64 the\r
+ # group above was deliberately skipped, so warning here would be noise about\r
+ # a decision this script made on purpose two steps ago.\r
+ if ($IsArm64) {\r
+ Write-Host ' v141 / Windows XP toolset: n/a on ARM64 (not offered for Arm hosts).' -ForegroundColor DarkGray\r
+ } else {\r
+ $V141 = Get-ChildItem $msvcRoot -Directory -ErrorAction SilentlyContinue |\r
+ Where-Object { $_.Name -like '14.16.*' } | Select-Object -First 1\r
+ if ($V141) {\r
+ Write-Host " OK: v141 toolset present ($($V141.Name))" -ForegroundColor Green\r
+ } else {\r
+ Write-Warning 'v141 (14.16.x) toolset NOT found - the XP build presets will fail.'\r
+ Write-Warning 'Add it via Visual Studio Installer > Modify > Individual components:'\r
+ Write-Warning ' - MSVC v141 - VS 2017 C++ x64/x86 build tools (v14.16)'\r
+ Write-Warning ' - C++ Windows XP Support for VS 2017 (v141) tools'\r
+ }\r
+ }\r