From 5ab8efd66a1a3c56f04a393ed1fe558ec8c1ba5c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 30 Sep 2019 14:23:55 +0200 Subject: 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 Reviewed-by: Oliver Wolff --- qmake/generators/metamakefile.cpp | 4 ++++ .../tools/qmake/testdata/conflicting_targets/conflicting_targets.pro | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 22a72100f7..b8b93bc8cb 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; QVector 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 c3e8034e35..bd0d4d824a 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 -- cgit v1.2.3