diff options
author | Radek Doulik <radek.doulik@gmail.com> | 2021-12-15 18:29:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 18:29:18 +0300 |
commit | 662aff66999c435aec09c58643e9fd703eadc3e0 (patch) | |
tree | fd28328b1a87403055c6c567b16b2d3a67ca6d26 | |
parent | 88d4fb233637975ba0deca837ad83c50d88303ac (diff) |
Fix dev machine local windows build (#148)
This fixes this error, where it mixed 2019 and 2022 VS installations:
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.3
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[ERROR:devinit.bat] File not found : "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\Tools\devinit\devinit.exe"
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
[ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
[ERROR:VsDevCmd.bat] Where [value] is:
[ERROR:VsDevCmd.bat] 1 : basic debug logging
[ERROR:VsDevCmd.bat] 2 : detailed debug logging
[ERROR:VsDevCmd.bat] 3 : trace level logging. Redirection of output to a file when using this level is recommended.
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
[ERROR:VsDevCmd.bat] vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
-rw-r--r-- | llvm.proj | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm.proj b/llvm.proj index 19be4705b0f7..73ea16476550 100644 --- a/llvm.proj +++ b/llvm.proj @@ -14,11 +14,14 @@ set VS_VCINSTALL_DIR= :: Try to locate installed VisualStudio VC environment. - if exist "%VSWHERE_TOOLS_BIN%" ( + if "%VCINSTALLDIR%" == "" if exist "%VSWHERE_TOOLS_BIN%" ( for /f "tokens=*" %%a in ('"%VSWHERE_TOOLS_BIN%" -latest -property installationPath') do ( set VS_VCINSTALL_DIR=%%a\VC\ ) ) + + if NOT "%VCINSTALLDIR%" == "" set VS_VCINSTALL_DIR=%VCINSTALLDIR% + :: Run VS build environment script. call "%VS_VCINSTALL_DIR%\Auxiliary\Build\$(_VCVarsScriptName)" |