Add Clang requirement to vswhere usage (#14187)

JohnMcPMS committed Feb 9, 2026 at 13:40 UTC 0f7ed1041b9905080cca7541ab8b6b47b590e45e
1 file changed +3 -2
CMakeLists.txt
+3 -2
@@ -260,8 +260,9 @@ endif()
260
261 # Determine the Visual Studio installation directory which contains LLVM tools
262 # N.B. The version is set to VS2022 to ensure local runs match pipeline behavior
263 +# Require that Clang be installed in the product to potentially de-deduplicate
264 execute_process(
264 - COMMAND "${VSWHERE_SOURCE_DIR}/vswhere.exe" -version "[17.0,18.0)" -products * -property installationPath
265 + COMMAND "${VSWHERE_SOURCE_DIR}/vswhere.exe" -version "[17.0,18.0)" -products * -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang -property installationPath
266 OUTPUT_VARIABLE VS_INSTALL_DIR
267 OUTPUT_STRIP_TRAILING_WHITESPACE
268 COMMAND_ERROR_IS_FATAL ANY
@@ -278,7 +279,7 @@ else()
279 endif()
280
281 if (NOT EXISTS ${LLVM_INSTALL_DIR})
281 - message(FATAL_ERROR "C++ Clang Compiler for Windows is not installed. Please install it from the Visual Studio Installer.")
282 + message(FATAL_ERROR "C++ Clang Compiler for Windows is not installed at ${LLVM_INSTALL_DIR}. Please install it from the Visual Studio Installer.")
283 endif()
284
285 # Generate the clang-format script which contains a path to clang-format.exe