Skip to content

Commit 167b131

Browse files
authored
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
1 parent 82beeea commit 167b131

File tree

5 files changed

+43
-6
lines changed

5 files changed

+43
-6
lines changed

kokoro/windows/msvc-14.14-x64/cmake/presubmit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env_vars {
1010

1111
env_vars {
1212
key: "BUILD_GENERATOR"
13-
value: "Visual Studio 15 2017 Win64"
13+
value: "Visual Studio 15 2017"
1414
}
1515

1616
env_vars {

kokoro/windows/msvc-14.14-x86/cmake/presubmit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ env_vars {
1515

1616
env_vars {
1717
key: "BUILD_TARGET_ARCH"
18-
value: "x86"
18+
value: "Win32"
1919
}

kokoro/windows/presubmit.bat

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@ if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
2626
git submodule update --init
2727
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
2828

29-
SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild"
3029
SET CONFIG=Release
3130

3231
mkdir %SRC%\build
3332
cd %SRC%\build
3433
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
3534

3635
IF /I "%BUILD_SYSTEM%"=="cmake" (
37-
cmake .. -G "%BUILD_GENERATOR%" "-DCPPDAP_BUILD_TESTS=1" "-DCPPDAP_BUILD_EXAMPLES=1" "-DCPPDAP_WARNINGS_AS_ERRORS=1"
36+
cmake .. -G "%BUILD_GENERATOR%" -A %BUILD_TARGET_ARCH% "-DCPPDAP_BUILD_TESTS=1" "-DCPPDAP_BUILD_EXAMPLES=1" "-DCPPDAP_WARNINGS_AS_ERRORS=1"
3837
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
39-
%MSBUILD% /p:Configuration=%CONFIG% cppdap.sln
38+
cmake --build . --config %CONFIG%
4039
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
41-
Release\cppdap-unittests.exe
40+
%CONFIG%\cppdap-unittests.exe
4241
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
4342
) ELSE (
4443
echo "Unknown build system: %BUILD_SYSTEM%"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Location of the continuous bash script in Git.
4+
build_file: "cppdap/kokoro/windows/presubmit.bat"
5+
6+
env_vars {
7+
key: "BUILD_SYSTEM"
8+
value: "cmake"
9+
}
10+
11+
env_vars {
12+
key: "BUILD_GENERATOR"
13+
value: "Visual Studio 17 2022"
14+
}
15+
16+
env_vars {
17+
key: "BUILD_TARGET_ARCH"
18+
value: "x64"
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Location of the continuous bash script in Git.
4+
build_file: "cppdap/kokoro/windows/presubmit.bat"
5+
6+
env_vars {
7+
key: "BUILD_SYSTEM"
8+
value: "cmake"
9+
}
10+
11+
env_vars {
12+
key: "BUILD_GENERATOR"
13+
value: "Visual Studio 17 2022"
14+
}
15+
16+
env_vars {
17+
key: "BUILD_TARGET_ARCH"
18+
value: "Win32"
19+
}

0 commit comments

Comments
 (0)