summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <[email protected]>2019-09-30 14:23:55 +0200
committerJoerg Bornemann <[email protected]>2019-10-03 20:28:03 +0200
commit5ab8efd66a1a3c56f04a393ed1fe558ec8c1ba5c (patch)
tree64162f2b1ddfeb337d049cd36506c96e9fe9dc7c
parentce5dc3193279cdbcc34b583151ba05464444dd5a (diff)
Make conflicting targets check less strict
People tend to "turn off debug and release builds" by just not building one of the variants. For example, Qt's own rcc is built in release only, however it is configured for debug_and_release with the same TARGET for both. Let qmake complain about conflicting TARGETs only we're about to build all of those conflicting targets, i.e. if build_all is set. Change-Id: I0448bf5cb421e2d801d3cc30e0d80353fba0d999 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
-rw-r--r--qmake/generators/metamakefile.cpp4
-rw-r--r--tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro2
2 files changed, 5 insertions, 1 deletions
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 22a72100f7b..b8b93bc8cbc 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -252,6 +252,10 @@ void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
// and the last entry in makefiles is the "glue" Build.
return;
}
+ if (!project->isActiveConfig("build_all")) {
+ // Only complain if we're about to build all configurations.
+ return;
+ }
using TargetInfo = std::pair<Build *, ProString>;
QVector<TargetInfo> targets;
const int last = makefiles.count() - 1;
diff --git a/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro b/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro
index c3e8034e35d..bd0d4d824a9 100644
--- a/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro
+++ b/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro
@@ -1,5 +1,5 @@
TEMPLATE = app
-CONFIG += debug_and_release
+CONFIG += debug_and_release build_all
TARGET = bah
DESTDIR = shu
SOURCES += main.cpp