summaryrefslogtreecommitdiffstats
path: root/qmake/generators/metamakefile.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-08-06 12:24:37 +0200
committerLars Knoll <lars.knoll@qt.io>2019-08-07 12:50:28 +0200
commit05b90be3c5ce4709156178478abb2e7ba125a0be (patch)
treea7c39b76c99f4887dbc6837be3a41afc7fdb29b4 /qmake/generators/metamakefile.cpp
parent7301e44161d8bb25410219a31405584c9492b83e (diff)
parent6f357f50b4b72e3c5a6903a09624ade1d72d12c1 (diff)
Merge "Merge remote-tracking branch 'origin/dev' into wip/qt6"
Diffstat (limited to 'qmake/generators/metamakefile.cpp')
-rw-r--r--qmake/generators/metamakefile.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index f9159ccd75..705ad7008a 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -57,6 +57,7 @@ private:
QList<Build *> makefiles;
void clearBuilds();
MakefileGenerator *processBuild(const ProString &);
+ void accumulateVariableFromBuilds(const ProKey &name, Build *build) const;
public:
@@ -95,9 +96,6 @@ BuildsMetaMakefileGenerator::init()
if(builds.count() > 1 && Option::output.fileName() == "-") {
use_single_build = true;
warn_msg(WarnLogic, "Cannot direct to stdout when using multiple BUILDS.");
- } else if(0 && !use_single_build && project->first("TEMPLATE") == "subdirs") {
- use_single_build = true;
- warn_msg(WarnLogic, "Cannot specify multiple builds with TEMPLATE subdirs.");
}
if(!use_single_build) {
for(int i = 0; i < builds.count(); i++) {
@@ -188,6 +186,7 @@ BuildsMetaMakefileGenerator::write()
if(!build->makefile) {
ret = false;
} else if(build == glue) {
+ accumulateVariableFromBuilds("QMAKE_INTERNAL_INCLUDED_FILES", build);
ret = build->makefile->writeProjectMakefile();
} else {
ret = build->makefile->write();
@@ -230,6 +229,16 @@ MakefileGenerator
return nullptr;
}
+void BuildsMetaMakefileGenerator::accumulateVariableFromBuilds(const ProKey &name, Build *dst) const
+{
+ ProStringList &values = dst->makefile->projectFile()->values(name);
+ for (auto build : makefiles) {
+ if (build != dst)
+ values += build->makefile->projectFile()->values(name);
+ }
+ values.removeDuplicates();
+}
+
class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
{
protected:
@@ -327,17 +336,13 @@ SubdirsMetaMakefileGenerator::init()
hasError |= tmpError;
}
sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name);
- if(0 && sub->makefile->type() == SUBDIRSMETATYPE) {
- subs.append(sub);
- } else {
- const QString output_name = Option::output.fileName();
- Option::output.setFileName(sub->output_file);
- hasError |= !sub->makefile->write();
- delete sub;
- qmakeClearCaches();
- sub = nullptr;
- Option::output.setFileName(output_name);
- }
+ const QString output_name = Option::output.fileName();
+ Option::output.setFileName(sub->output_file);
+ hasError |= !sub->makefile->write();
+ delete sub;
+ qmakeClearCaches();
+ sub = nullptr;
+ Option::output.setFileName(output_name);
Option::output_dir = old_output_dir;
qmake_setpwd(oldpwd);