kokoro: Add vs2022 configs (#139)

Pass target CPU architecture explicitly vis BUILD_TARGET_ARCH

Use cmake --build to build, instead of hardcoding the path to msbuild
This commit is contained in:
David Neto
2025-01-10 17:29:58 -05:00
committed by GitHub
parent 82beeea910
commit 167b131a66
5 changed files with 43 additions and 6 deletions

View File

@@ -26,7 +26,6 @@ if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
git submodule update --init
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild"
SET CONFIG=Release
mkdir %SRC%\build
@@ -34,11 +33,11 @@ cd %SRC%\build
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
IF /I "%BUILD_SYSTEM%"=="cmake" (
cmake .. -G "%BUILD_GENERATOR%" "-DCPPDAP_BUILD_TESTS=1" "-DCPPDAP_BUILD_EXAMPLES=1" "-DCPPDAP_WARNINGS_AS_ERRORS=1"
cmake .. -G "%BUILD_GENERATOR%" -A %BUILD_TARGET_ARCH% "-DCPPDAP_BUILD_TESTS=1" "-DCPPDAP_BUILD_EXAMPLES=1" "-DCPPDAP_WARNINGS_AS_ERRORS=1"
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
%MSBUILD% /p:Configuration=%CONFIG% cppdap.sln
cmake --build . --config %CONFIG%
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
Release\cppdap-unittests.exe
%CONFIG%\cppdap-unittests.exe
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
) ELSE (
echo "Unknown build system: %BUILD_SYSTEM%"