Skip to content

Commit

Permalink
Set env vars for location of VC++ compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarditi committed Nov 27, 2023
1 parent 0f4418c commit 80993f2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test_scripts/automation/Windows/run-cmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@ if "%BUILD_PACKAGE%"=="Yes" (
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 (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)

if exist "%InstallDir%\VC\Auxiliary\Build" (
"%InstallDir%\VC\Auxiliary\BuildC\vcvars32.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
if ERRORLEVEL 1 (goto cmdfailed)
endlocal

:succeeded
cd %OLD_DIR%
Expand Down

0 comments on commit 80993f2

Please sign in to comment.