Skip to content

Commit 48aef81

Browse files
committed
fix(Vcvars): Ensure message reflects correct variable being set
Set `Vcvars_MSVC_VERSION` directly instead of using an intermediate `_msvc_version` to ensure that the printed message refers to the correct variable name. Before: -- Setting _msvc_version to '1949' as it was the newest Visual Studio installed providing vcvars scripts After: -- Setting Vcvars_MSVC_VERSION to '1949' as it was the newest Visual Studio installed providing vcvars scripts
1 parent 48a7a19 commit 48aef81

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

FindVcvars.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,19 +504,17 @@ if(NOT DEFINED Vcvars_MSVC_VERSION)
504504
Vcvars_FindFirstValidMsvcVersion(
505505
"${Vcvars_MSVC_ARCH}"
506506
"${_Vcvars_SUPPORTED_MSVC_VERSIONS}"
507-
_msvc_version
507+
Vcvars_MSVC_VERSION
508508
_batch_file
509509
)
510510
if(_batch_file)
511-
set(Vcvars_MSVC_VERSION ${_msvc_version})
512511
Vcvars_ConvertMsvcVersionToVsVersion(${Vcvars_MSVC_VERSION} _vs_version)
513512
set(Vcvars_BATCH_FILE ${_batch_file}
514513
CACHE FILEPATH "Visual Studio ${_vs_version} vcvars script"
515514
)
516515
unset(_vs_version)
517516
endif()
518517
unset(_batch_file)
519-
unset(_msvc_version)
520518
endif()
521519

522520
if(NOT DEFINED Vcvars_PLATFORM_TOOLSET_VERSION)

0 commit comments

Comments
 (0)