From: Nikita Popov Date: Tue, 23 Apr 2019 11:24:29 +0000 (+0200) Subject: Enable -Werror in CI X-Git-Tag: php-7.4.0alpha1~413 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33e8a7b36879c82d9e495e8c5340e58c6d9ded34;p=php Enable -Werror in CI Add --enable-werror configure option and use it on Travis. It's not possible to directly use CFLAGS, because it also affects configure checks which often throw warnings. We can't enable something similar for Windows builds at this time, because they throw a lot more warnings. --- diff --git a/configure.ac b/configure.ac index b1e9becfd9..8f15c1a446 100644 --- a/configure.ac +++ b/configure.ac @@ -1089,6 +1089,12 @@ else AC_MSG_RESULT([using system default]) fi +PHP_ARG_ENABLE([werror],, + [AS_HELP_STRING([--enable-werror], + [Enable -Werror])], + [no], + [no]) + dnl Extension configuration. dnl ------------------------------------------------------------------------- @@ -1461,6 +1467,11 @@ if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then CPPFLAGS="$CPPFLAGS -DTHREAD=1" fi +if test "$PHP_WERROR" = "yes"; then + CFLAGS="$CFLAGS -Werror" + CPPFLAGS="$CPPFLAGS -Werror" +fi + ZEND_EXT_TYPE="zend_extension" PHP_SUBST(ZEND_EXT_TYPE) diff --git a/travis/compile.sh b/travis/compile.sh index 65c11ff378..0884eb36cf 100755 --- a/travis/compile.sh +++ b/travis/compile.sh @@ -74,6 +74,7 @@ $TS \ --with-kerberos \ --enable-sysvmsg \ --enable-zend-test=shared \ +--enable-werror \ > "$CONFIG_LOG_FILE" make "-j${MAKE_JOBS}" $MAKE_QUIET > "$MAKE_LOG_FILE"