Skip to content

Commit

Permalink
kokoro: Add vs2022 configs (#139)
Browse files Browse the repository at this point in the history
Pass target CPU architecture explicitly vis BUILD_TARGET_ARCH

Use cmake --build to build, instead of hardcoding the path to msbuild
  • Loading branch information
dneto0 authored Jan 10, 2025
1 parent 82beeea commit 167b131
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kokoro/windows/msvc-14.14-x64/cmake/presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env_vars {

env_vars {
key: "BUILD_GENERATOR"
value: "Visual Studio 15 2017 Win64"
value: "Visual Studio 15 2017"
}

env_vars {
Expand Down
2 changes: 1 addition & 1 deletion kokoro/windows/msvc-14.14-x86/cmake/presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ env_vars {

env_vars {
key: "BUILD_TARGET_ARCH"
value: "x86"
value: "Win32"
}
7 changes: 3 additions & 4 deletions kokoro/windows/presubmit.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ 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
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%"
Expand Down
19 changes: 19 additions & 0 deletions kokoro/windows/vs2022-amd64/cmake/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Location of the continuous bash script in Git.
build_file: "cppdap/kokoro/windows/presubmit.bat"

env_vars {
key: "BUILD_SYSTEM"
value: "cmake"
}

env_vars {
key: "BUILD_GENERATOR"
value: "Visual Studio 17 2022"
}

env_vars {
key: "BUILD_TARGET_ARCH"
value: "x64"
}
19 changes: 19 additions & 0 deletions kokoro/windows/vs2022-x86/cmake/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Location of the continuous bash script in Git.
build_file: "cppdap/kokoro/windows/presubmit.bat"

env_vars {
key: "BUILD_SYSTEM"
value: "cmake"
}

env_vars {
key: "BUILD_GENERATOR"
value: "Visual Studio 17 2022"
}

env_vars {
key: "BUILD_TARGET_ARCH"
value: "Win32"
}

0 comments on commit 167b131

Please sign in to comment.