Skip to content

Commit

Permalink
Set up VC compiler environment earlier.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarditi committed Nov 27, 2023
1 parent 4235b04 commit 01decd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
10 changes: 9 additions & 1 deletion test_scripts/automation/Windows/config-vars.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ rem running it manually, the variables must be set by the user.

rem Create configuration variables

set MSBUILD_VERBOSITY=n
rem Set up the environment for the Visual C++ compiler.

for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)

if exist "%InstallDir%\VC\Auxiliary\Build" (
call "%InstallDir%\VC\Auxiliary\Build\vcvars64.bat"
)

if NOT DEFINED BUILD_CHECKEDC_CLEAN (
if DEFINED BUILD_CLEAN (
Expand Down
11 changes: 0 additions & 11 deletions test_scripts/automation/Windows/run-cmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,7 @@ set OLD_DIR=%CD%

cd %LLVM_OBJ_DIR%

rem Set up the environment so CMake can find the Visual C++ compiler.
setlocal
for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)

if exist "%InstallDir%\VC\Auxiliary\Build" (
call "%InstallDir%\VC\Auxiliary\Build\vcvars64.bat"
)

cmake -G Ninja %EXTRA_FLAGS% -DCMAKE_BUILD_TYPE=%BUILDCONFIGURATION% -DLLVM_ENABLE_PROJECTS=clang -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\llvm
endlocal

:succeeded
cd %OLD_DIR%
Expand Down

0 comments on commit 01decd2

Please sign in to comment.