From 0f7c1023e522972a6e3ebd8dfe95752767e43f49 Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 13 Dec 2024 14:29:37 -0500 Subject: [PATCH 1/6] Disable warnings in googlesource This is required in order to build with GCC 13 with warnings-as-errors --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e34e17..7354e85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,6 +301,9 @@ if(CPPDAP_BUILD_TESTS) list(APPEND DAP_TEST_LIST ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc ) + set_property(SOURCE + ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc + APPEND PROPERTY COMPILE_OPTIONS -w) set(DAP_TEST_INCLUDE_DIR ${CPPDAP_GOOGLETEST_DIR}/googlemock/include/ From 31d1da90115cbba6d22516f2b85d79f771b6e4de Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 13 Dec 2024 14:31:54 -0500 Subject: [PATCH 2/6] kokoro: linux,win: cmake-3.31 Also: Linux: gcc-13, cmake-3.31.2 Windows: python 3.12 Bug: crbug.com/383538610 --- kokoro/ubuntu/presubmit-docker.sh | 4 ++-- kokoro/windows/presubmit.bat | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kokoro/ubuntu/presubmit-docker.sh b/kokoro/ubuntu/presubmit-docker.sh index c9caae2..b779160 100755 --- a/kokoro/ubuntu/presubmit-docker.sh +++ b/kokoro/ubuntu/presubmit-docker.sh @@ -28,8 +28,8 @@ git config --global --add safe.directory '*' git submodule update --init if [ "$BUILD_SYSTEM" == "cmake" ]; then - using cmake-3.17.2 - using gcc-9 + using cmake-3.31.2 + using gcc-13 mkdir build cd build diff --git a/kokoro/windows/presubmit.bat b/kokoro/windows/presubmit.bat index 91d3406..ad3be81 100644 --- a/kokoro/windows/presubmit.bat +++ b/kokoro/windows/presubmit.bat @@ -17,7 +17,7 @@ REM limitations under the License. SETLOCAL ENABLEDELAYEDEXPANSION SET BUILD_ROOT=%cd% -SET PATH=C:\python36;C:\Program Files\cmake-3.23.1-windows-x86_64\bin;%PATH% +SET PATH=C:\python312;C:\cmake-3.31.2\bin;%PATH% SET SRC=%cd%\github\cppdap cd %SRC% From 1efedac4ee21b35d5507de7264d02c9b7c2fc695 Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 13 Dec 2024 17:56:12 -0500 Subject: [PATCH 3/6] disable license check on .github/workflows/main.yml --- license-checker.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/license-checker.cfg b/license-checker.cfg index fcc9142..163aec7 100644 --- a/license-checker.cfg +++ b/license-checker.cfg @@ -8,6 +8,7 @@ "exclude": [ ".clang-format", ".gitattributes", + ".github/workflows/main.yml", ".gitignore", ".gitmodules", ".vscode/*.json", From 669eb3eae143f27d2ec7e3d188921c28f1a8b4ce Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Fri, 13 Dec 2024 18:17:48 -0500 Subject: [PATCH 4/6] Use add_subdirectory for internal gtest --- CMakeLists.txt | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7354e85..c54ea90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,18 +298,9 @@ if(CPPDAP_BUILD_TESTS) if(CPPDAP_USE_EXTERNAL_GTEST_PACKAGE) find_package(GTest REQUIRED) else() - list(APPEND DAP_TEST_LIST - ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc - ) - set_property(SOURCE - ${CPPDAP_GOOGLETEST_DIR}/googletest/src/gtest-all.cc - APPEND PROPERTY COMPILE_OPTIONS -w) - - set(DAP_TEST_INCLUDE_DIR - ${CPPDAP_GOOGLETEST_DIR}/googlemock/include/ - ${CPPDAP_GOOGLETEST_DIR}/googletest/ - ${CPPDAP_GOOGLETEST_DIR}/googletest/include/ - ) + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) + add_subdirectory(${CPPDAP_GOOGLETEST_DIR}) endif() add_executable(cppdap-unittests ${DAP_TEST_LIST}) @@ -329,7 +320,7 @@ if(CPPDAP_BUILD_TESTS) if(CPPDAP_USE_EXTERNAL_GTEST_PACKAGE) target_link_libraries(cppdap-unittests PRIVATE cppdap GTest::gtest) else() - target_link_libraries(cppdap-unittests PRIVATE cppdap) + target_link_libraries(cppdap-unittests PRIVATE cppdap gtest gmock) endif() endif(CPPDAP_BUILD_TESTS) From fa1ffec0dec027e8e0ea903510d0077e281c9350 Mon Sep 17 00:00:00 2001 From: David Neto Date: Mon, 16 Dec 2024 10:25:47 -0500 Subject: [PATCH 5/6] Disable warnings in googletest code GCC 13 issues a maybe-uninitialized warning on googletest code. Use -w to disable it. Note: MSVC understands -w --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c54ea90..192e025 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,6 +301,9 @@ if(CPPDAP_BUILD_TESTS) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) add_subdirectory(${CPPDAP_GOOGLETEST_DIR}) + # googletest has -Werror=maybe-uninitialized problem. + # Disable all warnings in googletest code. + target_compile_options(gtest PRIVATE -w) endif() add_executable(cppdap-unittests ${DAP_TEST_LIST}) From 7089a8c0ca14f27dd9bd97ed20610d70cd8df701 Mon Sep 17 00:00:00 2001 From: David Neto Date: Mon, 16 Dec 2024 10:40:40 -0500 Subject: [PATCH 6/6] Disable warnings in gmock --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 192e025..1c60699 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,15 +301,16 @@ if(CPPDAP_BUILD_TESTS) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) add_subdirectory(${CPPDAP_GOOGLETEST_DIR}) - # googletest has -Werror=maybe-uninitialized problem. + # googletest has -Werror=maybe-uninitialized problems. # Disable all warnings in googletest code. target_compile_options(gtest PRIVATE -w) + # gmock has -Werror=deprecated-copy problems. + target_compile_options(gmock PRIVATE -w) endif() add_executable(cppdap-unittests ${DAP_TEST_LIST}) add_test(NAME cppdap-unittests COMMAND cppdap-unittests) - target_include_directories(cppdap-unittests PUBLIC ${DAP_TEST_INCLUDE_DIR} ) set_target_properties(cppdap-unittests PROPERTIES FOLDER "Tests" )