From 68d8020d299fd6ac8e7273b676abf35c79e3212d 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 e3f1532..90fe68b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -207,7 +207,7 @@ jobs: if: ${{ matrix.variant == 'i386' }} run: | mkdir build - CFLAGS="-m32" LDFLAGS="-m32" meson setup . build + CFLAGS="-m32" LDFLAGS="-m32" meson setup -Dwerror=true . build - name: Meson init with cross compile if: ${{ matrix.variant == 'cross-compile' }} @@ -227,13 +227,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 -Dwerror=true --cross-file cross.txt . build - name: Meson init if: ${{ matrix.variant == '' }} run: | mkdir build - meson setup . build + meson setup -Dwerror=true . build - name: Compile run: ninja -C build diff --git a/meson.build b/meson.build index 0392b0e..af89704 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',