configure: add --enable-werror
Change-Id: Ife3716c667d2e9b3fcd94d3cdc044d594e7dab5a
This commit is contained in:
parent
dd335ef8fc
commit
0bd1e0d6eb
19
configure.ac
19
configure.ac
|
@ -53,6 +53,25 @@ then
|
||||||
CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
|
CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(werror,
|
||||||
|
[AS_HELP_STRING(
|
||||||
|
[--enable-werror],
|
||||||
|
[Turn all compiler warnings into errors, with exceptions:
|
||||||
|
a) deprecation (allow upstream to mark deprecation without breaking builds);
|
||||||
|
b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
|
||||||
|
]
|
||||||
|
)],
|
||||||
|
[werror=$enableval], [werror="no"])
|
||||||
|
if test x"$werror" = x"yes"
|
||||||
|
then
|
||||||
|
WERROR_FLAGS="-Werror"
|
||||||
|
WERROR_FLAGS+=" -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition"
|
||||||
|
WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
|
||||||
|
WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
|
||||||
|
CFLAGS="$CFLAGS $WERROR_FLAGS"
|
||||||
|
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_SUBST([CPPFLAGS])
|
AC_SUBST([CPPFLAGS])
|
||||||
AC_SUBST([CFLAGS])
|
AC_SUBST([CFLAGS])
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc])
|
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc])
|
||||||
|
|
Loading…
Reference in New Issue