From ba8fa6e30071c0e30c16d9e9dbe117ce34d08692 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Thu, 19 Oct 2023 23:47:50 +0100 Subject: [PATCH] only enable -Werror in CI Enabling -Werror by default sucks for everyone who isn't maintaining CDBA. By all means we should enable it in CI, but not for users and not for folks packaging it in distros. Remove it from the flags in meson.build, and use mesons built in option to enable it only in CI. See: https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/ Signed-off-by: Caleb Connolly --- .github/workflows/ci.yml | 6 +++--- meson.build | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4742f0c..3779bfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -208,7 +208,7 @@ jobs: if: ${{ matrix.variant == 'i386' }} run: | mkdir build - CFLAGS="-m32" LDFLAGS="-m32" meson setup . build + CFLAGS="-m32" LDFLAGS="-m32" meson setup --errorlogs --werror . build - name: Meson init with cross compile if: ${{ matrix.variant == 'cross-compile' }} @@ -228,13 +228,13 @@ jobs: echo "pkg_config_libdir = '${PKG_CONFIG_PATH}'" >> cross.txt cat cross.txt mkdir build - meson setup --cross-file cross.txt . build + meson setup --errorlogs --werror --cross-file cross.txt . build - name: Meson init if: ${{ matrix.variant == '' }} run: | mkdir build - meson setup . build + meson setup --errorlogs --werror . build - name: Compile run: ninja -C build diff --git a/meson.build b/meson.build index 1b1e01b..63cb838 100644 --- a/meson.build +++ b/meson.build @@ -26,8 +26,7 @@ compiler_cflags = ['-Wno-unused-parameter', # TODO add clang specific options if compiler.get_id() == 'gcc' - compiler_cflags += ['-Werror', # Only set it on GCC - '-Wformat-signedness', + compiler_cflags += ['-Wformat-signedness', '-Wduplicated-cond', '-Wduplicated-branches', '-Wvla-larger-than=1',