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 <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Joerg Bornemann 2019-09-30 14:23:55 +02:00
parent ce5dc31932
commit 5ab8efd66a
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -1,5 +1,5 @@
TEMPLATE = app
CONFIG += debug_and_release
CONFIG += debug_and_release build_all
TARGET = bah
DESTDIR = shu
SOURCES += main.cpp