Skip to content

Commit 9fd09d6

Browse files
dneto0amaiorano
andauthored
kokoro: update tooling, fix warnings
Kokoro changes: - Linux: gcc-13, cmake-3.31.2 - Windows: python 3.12, cmake-3.31.2 * Disable warnings in gtest, gmock This is required in order to build with GCC 13, and Apple Clang with warnings-as-errors Bug: crbug.com/383538610 * disable license check on .github/workflows/main.yml * Use add_subdirectory for internal gtest, gmock --------- Co-authored-by: Antonio Maiorano <amaiorano@google.com>
1 parent c69444e commit 9fd09d6

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

CMakeLists.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,21 +298,19 @@ if(CPPDAP_BUILD_TESTS)
298298
if(CPPDAP_USE_EXTERNAL_GTEST_PACKAGE)
299299
find_package(GTest REQUIRED)
300300
else()
301-
list(APPEND DAP_TEST_LIST
302-
${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc
303-
)
304-
305-
set(DAP_TEST_INCLUDE_DIR
306-
${CPPDAP_GOOGLETEST_DIR}/googlemock/include/
307-
${CPPDAP_GOOGLETEST_DIR}/googletest/
308-
${CPPDAP_GOOGLETEST_DIR}/googletest/include/
309-
)
301+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
302+
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
303+
add_subdirectory(${CPPDAP_GOOGLETEST_DIR})
304+
# googletest has -Werror=maybe-uninitialized problems.
305+
# Disable all warnings in googletest code.
306+
target_compile_options(gtest PRIVATE -w)
307+
# gmock has -Werror=deprecated-copy problems.
308+
target_compile_options(gmock PRIVATE -w)
310309
endif()
311310

312311
add_executable(cppdap-unittests ${DAP_TEST_LIST})
313312
add_test(NAME cppdap-unittests COMMAND cppdap-unittests)
314313

315-
target_include_directories(cppdap-unittests PUBLIC ${DAP_TEST_INCLUDE_DIR} )
316314
set_target_properties(cppdap-unittests PROPERTIES
317315
FOLDER "Tests"
318316
)
@@ -326,7 +324,7 @@ if(CPPDAP_BUILD_TESTS)
326324
if(CPPDAP_USE_EXTERNAL_GTEST_PACKAGE)
327325
target_link_libraries(cppdap-unittests PRIVATE cppdap GTest::gtest)
328326
else()
329-
target_link_libraries(cppdap-unittests PRIVATE cppdap)
327+
target_link_libraries(cppdap-unittests PRIVATE cppdap gtest gmock)
330328
endif()
331329
endif(CPPDAP_BUILD_TESTS)
332330

kokoro/ubuntu/presubmit-docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ git config --global --add safe.directory '*'
2828
git submodule update --init
2929

3030
if [ "$BUILD_SYSTEM" == "cmake" ]; then
31-
using cmake-3.17.2
32-
using gcc-9
31+
using cmake-3.31.2
32+
using gcc-13
3333

3434
mkdir build
3535
cd build

kokoro/windows/presubmit.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ REM limitations under the License.
1717
SETLOCAL ENABLEDELAYEDEXPANSION
1818

1919
SET BUILD_ROOT=%cd%
20-
SET PATH=C:\python36;C:\Program Files\cmake-3.23.1-windows-x86_64\bin;%PATH%
20+
SET PATH=C:\python312;C:\cmake-3.31.2\bin;%PATH%
2121
SET SRC=%cd%\github\cppdap
2222

2323
cd %SRC%

license-checker.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"exclude": [
99
".clang-format",
1010
".gitattributes",
11+
".github/workflows/main.yml",
1112
".gitignore",
1213
".gitmodules",
1314
".vscode/*.json",

0 commit comments

Comments
 (0)