diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2021-03-01 10:36:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 18:36:58 +0000 |
commit | 7029d2c168cb49d3b9552f505a00cc7f538bc100 (patch) | |
tree | 10c4dc80c3ef9c41d2486a9f26d941da62330e30 | |
parent | 9b48d6e5abd3682ec64cd3f6c9b024fa2a7321aa (diff) |
Make -Werror optional but enable it for CI. (#6032)
-rw-r--r-- | .github/workflows/ci.yml | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rwxr-xr-x | configure.sh | 9 |
3 files changed, 11 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd6b65998..abd47ec97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,7 +155,8 @@ jobs: run: | ${{ matrix.env }} ./configure.sh ${{ matrix.config }} \ --prefix=$(pwd)/build/install \ - --unit-testing + --unit-testing \ + --werror - name: Build run: make -j2 diff --git a/CMakeLists.txt b/CMakeLists.txt index c32c10f4d..b48974cc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,6 @@ include(Config${CMAKE_BUILD_TYPE}) add_check_c_cxx_flag("-O${OPTIMIZATION_LEVEL}") add_check_c_cxx_flag("-Wall") -add_check_c_cxx_flag("-Werror") add_check_c_cxx_flag("-Wno-unused-private-field") add_check_c_flag("-fexceptions") add_check_cxx_flag("-Wsuggest-override") diff --git a/configure.sh b/configure.sh index 419d66ea8..1e036e548 100755 --- a/configure.sh +++ b/configure.sh @@ -51,6 +51,7 @@ The following flags enable optional features (disable with --no-<option name>). --asan build with ASan instrumentation --ubsan build with UBSan instrumentation --tsan build with TSan instrumentation + --werror build with -Werror Optional Packages: The following flags enable optional packages (disable with --no-<option name>). @@ -150,6 +151,7 @@ ubsan=default unit_testing=default valgrind=default win64=default +werror=default abc_dir=default antlr_dir=default @@ -186,6 +188,8 @@ do --tsan) tsan=ON;; --no-tsan) tsan=OFF;; + --werror) werror=ON;; + --assertions) assertions=ON;; --no-assertions) assertions=OFF;; @@ -355,6 +359,11 @@ done #--------------------------------------------------------------------------# +if [ $werror != default ]; then + export CFLAGS=-Werror + export CXXFLAGS=-Werror +fi + cmake_opts="" [ $buildtype != default ] \ |