Skip to content

Commit

Permalink
only enable -Werror in CI
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
calebccff committed Oct 19, 2023
1 parent f09b3e1 commit 68d8020
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 68d8020

Please sign in to comment.