diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2019-07-31 15:00:29 +0200 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2019-08-01 01:58:11 +0200 |
commit | cd2903e03b2628c18c30b54dafffc101eb633acf (patch) | |
tree | fc60941dfb2371eb909363b0b83393fbd4797cb8 | |
parent | 2942f20a211f223b1388dc41076df7fabd670fc7 (diff) | |
download | libexif-cd2903e03b2628c18c30b54dafffc101eb633acf.tar.gz libexif-cd2903e03b2628c18c30b54dafffc101eb633acf.tar.bz2 libexif-cd2903e03b2628c18c30b54dafffc101eb633acf.zip |
Enabled -Werror on some Travis builds.
This will cause any compiler warnings to be treated as errors and fail
the CI build. A couple of warnings are grandfathered in until they are
fixed in the code.
The -Werror switch can't be added to the CFLAGS on the configure command
because it causes some autoconf tests to fail. Instead, it's appended to
the existing flags at make time.
-rw-r--r-- | .travis.yml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index 3ed8491..9c122a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -170,18 +170,18 @@ script: - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi - if [ "$CONFIG" = "disable-nls" ] ; then CFLAGS='-Wall -Wextra -O3'; CONFIGURE_OPTS='--disable-nls'; fi - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi - - if [ "$CONFIG" = "clang8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-8; fi - - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=gcc-8; fi + - if [ "$CONFIG" = "clang8" ] ; then CFLAGS='-Wall -Wextra -Wno-error=switch -O3'; MAKE_OPTS="CFLAGS+=-Werror CFLAGS+=${CFLAGS// / CFLAGS+=}"; export CC=clang-8; fi + - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -Wno-error=switch -Wno-error=implicit-fallthrough -O3'; MAKE_OPTS="CFLAGS+=-Werror CFLAGS+=${CFLAGS// / CFLAGS+=}"; export CC=gcc-8; fi - if [ "$CONFIG" = "arm-cross" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=arm-linux-gnueabihf-gcc-4.8; CONFIGURE_OPTS='--host=arm-linux-gnueabihf'; fi - if [ "$CONFIG" = "musl" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=musl-gcc; CONFIGURE_OPTS='--disable-shared'; fi - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined -fsanitize-address-use-after-scope'; export CC=clang-8; export ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=1; fi - - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib" ; fi + - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib"; fi - ./configure --prefix="$HOME"/install --disable-dependency-tracking CFLAGS="$CFLAGS" $CONFIGURE_OPTS || { tail -n 300 config.log; false; } - - make V=1 + - make V=1 $MAKE_OPTS # Skip tests when cross compiling. - - if [ "$CONFIG" != "arm-cross" ] ; then make V=1 check || { tail -n 300 test*/test-suite.log src/libexif/test*/test-suite.log; false; }; fi - - make V=1 install + - if [ "$CONFIG" != "arm-cross" ] ; then make V=1 $MAKE_OPTS check || { tail -n 300 test*/test-suite.log src/libexif/test*/test-suite.log; false; }; fi + - make V=1 $MAKE_OPTS install - if [ "$CONFIG" = "coverage" ] ; then cd "$TRAVIS_BUILD_DIR"; fi |