From 53aac0233cebe6d41cc03adf356009c83365d74d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 8 Feb 2019 13:42:16 +0100 Subject: [PATCH] build/ci: enable --werror for meson builds This enables -Werror for meson builds on gitlab-ci and semaphore. Not on Travis, the compiler there is too old, giving too many bogus warnings. This reverts commit 928d68d04af20808f801f05f92ad83179d7b826e ("m4: disable -Wmissing-braces for newer clang"). --- contrib/scripts/nm-ci-run.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index c3d0cb2e54..7072933677 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -45,13 +45,13 @@ else fi _WITH_CRYPTO="gnutls" -_WITH_MORE_WARNINGS="error" +_WITH_WERROR=1 _WITH_LIBTEAM="$_TRUE" _WITH_DOCS="$_TRUE" _WITH_SYSTEMD_LOGIND="$_TRUE" if [ "$CI" == travis ]; then - _WITH_MORE_WARNINGS="no" + _WITH_WERROR=0 _WITH_LIBTEAM="$_FALSE" _WITH_DOCS="$_FALSE" _WITH_SYSTEMD_LOGIND="$_FALSE" @@ -83,13 +83,18 @@ _autotools_test_print_logs() { run_autotools() { NOCONFIGURE=1 ./autogen.sh mkdir ./build + if [ "$_WITH_WERROR" == 1 ]; then + _WITH_WERROR_VAL="error" + else + _WITH_WERROR_VAL="yes" + fi pushd ./build ../configure \ --prefix="$PWD/INST" \ --enable-introspection=$_WITH_DOCS \ --enable-gtk-doc=$_WITH_DOCS \ --with-systemd-logind=$_WITH_SYSTEMD_LOGIND \ - --enable-more-warnings=$_WITH_MORE_WARNINGS \ + --enable-more-warnings="$_WITH_WERROR_VAL" \ --enable-tests=yes \ --with-crypto=$_WITH_CRYPTO \ \ @@ -139,7 +144,15 @@ run_autotools() { ############################################################################### run_meson() { + if [ "$_WITH_WERROR" == 1 ]; then + _WITH_WERROR_VAL="--werror" + else + _WITH_WERROR_VAL="" + fi meson build \ + \ + --warnlevel 2 \ + $_WITH_WERROR_VAL \ \ -D ld_gc=false \ -D session_tracking=no \