From 01decd254fbfb9925e04d4b5ac58e3384dc1e8ee Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Sun, 26 Nov 2023 20:42:44 -0800 Subject: [PATCH] Set up VC compiler environment earlier. --- test_scripts/automation/Windows/config-vars.bat | 10 +++++++++- test_scripts/automation/Windows/run-cmake.bat | 11 ----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/test_scripts/automation/Windows/config-vars.bat b/test_scripts/automation/Windows/config-vars.bat index 98b4ef5..630bbe3 100644 --- a/test_scripts/automation/Windows/config-vars.bat +++ b/test_scripts/automation/Windows/config-vars.bat @@ -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 ( diff --git a/test_scripts/automation/Windows/run-cmake.bat b/test_scripts/automation/Windows/run-cmake.bat index af8ac6d..559a44b 100644 --- a/test_scripts/automation/Windows/run-cmake.bat +++ b/test_scripts/automation/Windows/run-cmake.bat @@ -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%