[PATCH] D135173: Detect Visual Studio in Windows packaging script

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 10:47:43 PDT 2022


compnerd added inline comments.


================
Comment at: llvm/utils/release/build_llvm_release.bat:339
+if exist "%candidate%" set "vsdevcmd=%candidate%"
+exit /b 0
----------------
I think that this is better done through `vswhere` which is packaged up in the Visual Studio installation as of 2019 and newer.

```
SET vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe
FOR /F "delims=" %%r IN ('^""%vswhere%" -nologo -latest -products "*" -all -prerelease -property installationPath^"') DO set VsDevCmd=%%r\Common7\Tools\VsDevCmd.bat
```

Will give you the path to the latest vsdevcmd available in `VsDevCmd`.  It will also implicitly scan different editions, and avoids the need to scan for it manually.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135173/new/

https://reviews.llvm.org/D135173



More information about the llvm-commits mailing list