diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-12-21 18:31:54 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-28 23:43:36 +0100 |
commit | ebfd85a499a4382ace09d443b1f35cd6b1848af6 (patch) | |
tree | 3d957d0d57b49ee34b82a60f316ab5bb88e7e013 /tools | |
parent | 0520631b2ba04fb99d3d46385f04279cd89a7732 (diff) |
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 <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 29c1e4a661..67db7b3555 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1,6 +1,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 part of the tools applications of the Qt Toolkit. @@ -244,6 +245,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "CFG_GCC_SYSROOT" ] = "yes"; dictionary[ "SLOG2" ] = "no"; dictionary[ "SYSTEM_PROXIES" ] = "no"; + dictionary[ "WERROR" ] = "auto"; //Only used when cross compiling. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; @@ -891,6 +893,11 @@ void Configure::parseCmdLine() dictionary[ "SYSTEM_PROXIES" ] = "no"; } else if (configCmdLine.at(i) == "-system-proxies") { dictionary[ "SYSTEM_PROXIES" ] = "yes"; + } else if (configCmdLine.at(i) == "-warnings-are-errors" || + configCmdLine.at(i) == "-Werror") { + dictionary[ "WERROR" ] = "yes"; + } else if (configCmdLine.at(i) == "-no-warnings-are-errors") { + dictionary[ "WERROR" ] = "no"; } // Work around compiler nesting limitation @@ -1347,8 +1354,14 @@ void Configure::parseCmdLine() } // Allow tests for private classes to be compiled against internal builds - if (dictionary["BUILDDEV"] == "yes") - qtConfig += "private_tests"; + if (dictionary["BUILDDEV"] == "yes") { + qtConfig << "private_tests"; + if (dictionary["WERROR"] != "no") + qmakeConfig << "warnings_are_errors"; + } else { + if (dictionary["WERROR"] == "yes") + qmakeConfig << "warnings_are_errors"; + } if (dictionary["FORCE_ASSERTS"] == "yes") qtConfig += "force_asserts"; @@ -1718,6 +1731,8 @@ bool Configure::displayHelp() desc("SYSTEM_PROXIES", "yes", "-system-proxies", "Use system network proxies by default."); desc("SYSTEM_PROXIES", "no", "-no-system-proxies", "Do not use system network proxies by default.\n"); + desc("WERROR", "yes", "-warnings-are-errors", "Make warnings be treated as errors."); + desc("WERROR", "no", "-no-warnings-are-errors","Make warnings be treated normally."); #if !defined(EVAL) desc( "-qtnamespace <name>", "Wraps all Qt library code in 'namespace name {...}'."); |