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 Nov 6, 2023
1 parent 18bae8d commit ba8fa6e
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 @@ -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' }}
Expand All @@ -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
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 ba8fa6e

Please sign in to comment.