From ebfd85a499a4382ace09d443b1f35cd6b1848af6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 Dec 2012 18:31:54 -0800 Subject: Add the infrastructure to compile Qt with -Werror This is enabled only for -developer-builds and only for certain compiler-version combinations that are in a whitelist. It also requires each library, plugin or tool to declare whether it is supposedly clean of warnings. When most targets are clean, we can consider inverting. Change-Id: I17b5c4e45aee5078f9788e846a45d619c144095a Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- configure | 18 ++++++++++++++++++ mkspecs/features/qt_common.prf | 34 ++++++++++++++++++++++++++++++++++ tools/configure/configureapp.cpp | 19 +++++++++++++++++-- 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/configure b/configure index dbc82b4e47..777de4673e 100755 --- a/configure +++ b/configure @@ -2,6 +2,7 @@ ############################################################################# ## ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +## Copyright (C) 2013 Intel Corporation. ## Contact: http://www.qt-project.org/legal ## ## This file is the build configuration utility of the Qt Toolkit. @@ -893,6 +894,7 @@ CFG_PCRE=auto QPA_PLATFORM_GUARD=yes CFG_CXX11=auto CFG_DIRECTWRITE=no +CFG_WERROR=auto # initalize variables used for installation QT_INSTALL_PREFIX= @@ -2138,6 +2140,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + warnings-are-errors|Werror) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_WERROR="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; *) UNKNOWN_OPT=yes ;; @@ -3296,6 +3305,10 @@ Additional options: * -no-system-proxies .. Do not use system network proxies by default. -system-proxies ..... Use system network proxies by default. + -no-warnings-are-errors Make warnings be treated normally + -warnings-are-errors Make warnings be treated as errors + (enabled if -developer-build is active) + $GBN -no-glib ........... Do not compile Glib support. $GBY -glib .............. Compile Glib support. EOF @@ -6098,6 +6111,11 @@ else fi if [ "$CFG_DEV" = "yes" ]; then QT_CONFIG="$QT_CONFIG private_tests" + if [ "$CFG_WERROR" != "no" ]; then + QMAKE_CONFIG="$QMAKE_CONFIG warnings_are_errors" + fi +elif [ "$CFG_WERROR" = "yes" ]; then + QMAKE_CONFIG="$QMAKE_CONFIG warnings_are_errors" fi cat >>"$QTCONFIG.tmp" <", "Wraps all Qt library code in 'namespace name {...}'."); -- cgit v1.2.3