Skip to content

Commit 3bb968e

Browse files
committed
fix: using VCToolsInstallDir in build.cmd instead of custom checks
1 parent 65c9f38 commit 3bb968e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

build.cmd

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@echo off
2+
setlocal enabledelayedexpansion
23

34
set root_dir=%~dp0
45
set tools_dir=%~dp0.cache\tools\
@@ -21,25 +22,21 @@ for /f "usebackq tokens=*" %%i in (`%vswhere% -latest -products * -requires Micr
2122
set vs_install_dir=%%i
2223
)
2324

24-
if exist "%vs_install_dir%\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt" (
25-
set /p vs_tools_version=<"%vs_install_dir%\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"
26-
)
25+
call "%vs_install_dir%\Common7\Tools\vsdevcmd.bat" /no_logo
2726

28-
if "%vs_tools_version%"=="" (
29-
echo ERROR: cannot find VC tools installed on your system
27+
if "%VCToolsInstallDir%"=="" (
28+
echo ERROR: missing VCToolsInstallDir after running vsdevcmd.bat
3029
exit 1
3130
)
3231

33-
set vs_tools_dir=%vs_install_dir%\VC\Tools\MSVC\%vs_tools_version%
32+
set vs_tools_dir=%VCToolsInstallDir%
3433

3534
if exist .cache\repos\cppfront\ (
3635
@rem TODO - report which cppfront version is being used
3736
) else (
3837
git clone --quiet --branch=v0.8.1 --depth=1 https://github.com/hsutter/cppfront.git .cache/repos/cppfront
3938
)
4039

41-
call "%vs_install_dir%\Common7\Tools\vsdevcmd.bat" /no_logo
42-
4340
if not exist "%modules_dir%\std.ifc" (
4441
echo Compiling std module...
4542
pushd %modules_dir%

0 commit comments

Comments
 (0)