From 52f3eb063f41d3299875d18ac0cd8d9acc625bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Urs=20F=C3=A4ssler?= Date: Thu, 9 May 2024 21:39:57 +0200 Subject: [PATCH] only treat compilation warnings as error in CI Easier to work with the project as developer and with older (and probably newer) compilers. --- .github/workflows/linux-build.yml | 1 + .github/workflows/qt5.yml | 3 ++- .github/workflows/run-all.yml | 1 + CMakeLists.txt | 2 +- run-linux.sh | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 916c2b04..831b246d 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -57,6 +57,7 @@ jobs: - name: build run: | + export CXXFLAGS=-Werror cmake -E make_directory build cmake -E chdir build cmake \ -DCMAKE_CXX_COMPILER=${{ matrix.cpp-compiler }} \ diff --git a/.github/workflows/qt5.yml b/.github/workflows/qt5.yml index 1a9e80fa..a795d6fa 100644 --- a/.github/workflows/qt5.yml +++ b/.github/workflows/qt5.yml @@ -51,6 +51,7 @@ jobs: - name: build run: | + export CXXFLAGS=-Werror cmake -E make_directory build cmake -E chdir build cmake \ -G Ninja \ @@ -60,7 +61,7 @@ jobs: -DCUKE_ENABLE_EXAMPLES=on \ -DCUKE_TESTS_UNIT=on \ .. - cmake --build build --parallel + cmake --build build --parallel --verbose - name: unit tests run: | diff --git a/.github/workflows/run-all.yml b/.github/workflows/run-all.yml index 879981ea..dc1c83f3 100644 --- a/.github/workflows/run-all.yml +++ b/.github/workflows/run-all.yml @@ -56,6 +56,7 @@ jobs: - name: build and run run: | + export CXXFLAGS=-Werror ./run-linux.sh - name: code coverage summary report diff --git a/CMakeLists.txt b/CMakeLists.txt index cc983531..7b92ff49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,7 +98,7 @@ endif() # if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Werror -Wall -Wextra -Wsuggest-override ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -Wextra -Wsuggest-override ${CMAKE_CXX_FLAGS}") # TODO: A better fix should handle ld's --as-needed flag if(UNIX AND NOT APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker '--no-as-needed'") diff --git a/run-linux.sh b/run-linux.sh index cc74aea2..7f0c1730 100755 --- a/run-linux.sh +++ b/run-linux.sh @@ -15,7 +15,7 @@ cmake -E chdir build cmake \ -DCUKE_TESTS_UNIT=on \ -DCUKE_CODE_COVERAGE=on \ .. -cmake --build build --parallel +cmake --build build --parallel --verbose # # Run tests