summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-05-28 13:22:39 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-05-28 13:40:42 +0200
commit085d1335d16210467cbd29f44e046a0f5fe8970f (patch)
tree8810365d040696cf1e05e64150b5c9ae67dc4226
parent90c683e41cd978b55de57cb424a986db3b637fcc (diff)
Warn about invalid SUBDIRS content
Invalid SUBDIRS values like SUBDIRS += foo \ bar \ \ baz would produce a Makefile with a sub-- target that will call the make on the same Makefile again recursively, letting make run forever. Ignore values like this and print a warning message. Fixes: QTBUG-76068 Change-Id: I6ca0f8c8238249f1be02d8c311b4c148fd80e707 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--qmake/generators/makefile.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index d53dbf9fa5..bfef31f17e 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -2400,8 +2400,15 @@ MakefileGenerator::findSubDirsSubTargets() const
st->profile = file;
}
} else {
- if(!file.isEmpty() && !project->isActiveConfig("subdir_first_pro"))
- st->profile = file.section(Option::dir_sep, -1) + Option::pro_ext;
+ if (!file.isEmpty() && !project->isActiveConfig("subdir_first_pro")) {
+ const QString baseName = file.section(Option::dir_sep, -1);
+ if (baseName.isEmpty()) {
+ warn_msg(WarnLogic, "Ignoring invalid SUBDIRS entry %s",
+ subdirs[subdir].toLatin1().constData());
+ continue;
+ }
+ st->profile = baseName + Option::pro_ext;
+ }
st->in_directory = file;
}
while(st->in_directory.endsWith(Option::dir_sep))