summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorKeith Isdale <keith.isdale@nokia.com>2009-08-10 17:19:20 +1000
committerKeith Isdale <keith.isdale@nokia.com>2009-08-10 17:19:20 +1000
commit6cc14b9bd84de30471db40f73b119ba33356a6ba (patch)
tree4cf9cb9b3aee37021654335658458c25ea7602bf /qmake
parentd16ae8ffa8432541ddf481d4166a04e9cfa4e5b4 (diff)
In a .pro file the include() function does not warn if specified file
can not be found change that behavior to warn by default. Currently the default behavior of include() in a .pro file is not to warn if the supplied file argument can not be found which can lead to hard to find build errors. The include() will now,by default, warn if the specified file can not be found. If a warning is not required because the included file is optional then example use in the .pro file: include(SomePriFile.pri", "", true) Task-number:259398 Reviewed-by:Marius Storm-Olsen
Diffstat (limited to 'qmake')
-rw-r--r--qmake/project.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 4fefbabc7..6687e9a62 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -2693,10 +2693,15 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QMap<QSt
case T_LOAD: {
QString parseInto;
const bool include_statement = (func_t == T_INCLUDE);
- bool ignore_error = include_statement;
- if(args.count() == 2) {
+ bool ignore_error = false;
+ if(args.count() >= 2) {
if(func_t == T_INCLUDE) {
parseInto = args[1];
+ if (args.count() == 3){
+ QString sarg = args[2];
+ if (sarg.toLower() == "true" || sarg.toInt())
+ ignore_error = true;
+ }
} else {
QString sarg = args[1];
ignore_error = (sarg.toLower() == "true" || sarg.toInt());
@@ -2738,8 +2743,8 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QMap<QSt
if(stat == IncludeFeatureAlreadyLoaded) {
warn_msg(WarnParser, "%s:%d: Duplicate of loaded feature %s",
parser.file.toLatin1().constData(), parser.line_no, file.toLatin1().constData());
- } else if(stat == IncludeNoExist && include_statement) {
- warn_msg(WarnParser, "%s:%d: Unable to find file for inclusion %s",
+ } else if(stat == IncludeNoExist && !ignore_error) {
+ warn_msg(WarnAll, "%s:%d: Unable to find file for inclusion %s",
parser.file.toLatin1().constData(), parser.line_no, file.toLatin1().constData());
return false;
} else if(stat >= IncludeFailure) {