Skip to content

Commit eafabd9

Browse files
committed
Fix #8251 No artifacts produced from windows builds since VS 2022 was upgraded to v17.10
1 parent 1ea8281 commit eafabd9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

builds/win32/setenvvar.bat

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,22 @@ for %%v in ( %* ) do (
108108
:: suggest them.
109109
:: This has been tested on VS 2017, 2019 and 2022
110110
:: Note that VCToolsVersion is only defined after vcvarsall.bat been run.
111+
111112
@if defined VCToolsVersion (
112113
set MSVC_RUNTIME_MAJOR_VERSION=%VCToolsVersion:~0,2%
114+
set MSVC_RUNTIME_FILE_VERSION=%MSVC_RUNTIME_MAJOR_VERSION%0
115+
rem NOTE 1 Since the upgrade to VS 17.10.5 this attempt to set the runtime minor
116+
rem version is broken as it now returns '4'. Note also that vcvars.bat has v143
117+
rem hard-coded. It does not seem to be possible to dynamically derived the minor
118+
rem version using the available env vars so we test to see if the runtime dir
119+
rem exists and if not we fall back to 3.
120+
rem NOTE 2 This code is likely to break again in the future !!!!
113121
set MSVC_RUNTIME_MINOR_VERSION=%VCToolsVersion:~3,1%
122+
if not exist %VCToolsRedistDir%%VSCMD_ARG_TGT_ARCH%\Microsoft.VC%MSVC_RUNTIME_MAJOR_VERSION%%MSVC_RUNTIME_MINOR_VERSION%.CRT (
123+
set MSVC_RUNTIME_MINOR_VERSION=3
124+
)
114125
set MSVC_RUNTIME_LIBRARY_VERSION=%MSVC_RUNTIME_MAJOR_VERSION%%MSVC_RUNTIME_MINOR_VERSION%
115-
set MSVC_RUNTIME_FILE_VERSION=%MSVC_RUNTIME_MAJOR_VERSION%0
126+
116127
)
117128
@echo.
118129

0 commit comments

Comments
 (0)