Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1bded98

Browse filesBrowse files
richardlautargos
authored andcommitted
build: fix detection of Visual Studio 2017
When run in a Visual Studio 2017 command prompt the `VCINSTALLDIR` environment variable will be already set and is not cleared by the `tools/msvs/vswhere_usability_wrapper.cmd` utility when it fails to find Visual Studio 2019. This causes `vcbuild.bat` to incorrectly assume Visual Studio 2019 and generate an incompatible configuration. Clearing the value of `VCINSTALLDIR` before calling the utility fixes the detection logic. PR-URL: #30119 Fixes: #30118 Refs: #30022 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: João Reis <reis@janeasystems.com>
1 parent 49e7f04 commit 1bded98
Copy full SHA for 1bded98

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎vcbuild.bat‎

Copy file name to clipboardExpand all lines: vcbuild.bat
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ if %target_arch%==x86 if %msvs_host_arch%==x86 set vcvarsall_arg=x86
240240
:vs-set-2019
241241
if defined target_env if "%target_env%" NEQ "vs2019" goto vs-set-2017
242242
echo Looking for Visual Studio 2019
243+
@rem VCINSTALLDIR may be set if run from a VS Command Prompt and needs to be
244+
@rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to
245+
@rem detect the version searched for
246+
set "VCINSTALLDIR="
243247
call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)"
244248
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2017
245249
if defined msi (

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.