From 85ad131adbf56308918c46c1827f2d57a11d8116 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Jul 2020 15:37:38 +0200 Subject: [PATCH] Fix not handling #warning as errors for clang clang uses "#warnings" warning category instead of "cpp" as gcc does and complains about unknown "cpp" warning option if we use it with it. --- build/tools/travis-ci.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build/tools/travis-ci.sh b/build/tools/travis-ci.sh index adb2ddc8d6..81722a2017 100755 --- a/build/tools/travis-ci.sh +++ b/build/tools/travis-ci.sh @@ -68,7 +68,21 @@ case $wxTOOLSET in echo 'travis_fold:end:configure' if [ "$wxALLOW_WARNINGS" != 1 ]; then - error_opts="-Werror -Wno-error=cpp" + case "$TRAVIS_COMPILER" in + clang) + allow_warn_opt="-Wno-error=#warnings" + ;; + + gcc) + allow_warn_opt="-Wno-error=cpp" + ;; + + *) + echo "*** Unknown compiler: $TRAVIS_COMPILER ***" + ;; + esac + + error_opts="-Werror $allow_warn_opt" wxMAKEFILE_CXXFLAGS="$wxMAKEFILE_CXXFLAGS $error_opts" wxMAKEFILE_ERROR_CXXFLAGS="CXXFLAGS=$error_opts" fi