path: root/tools
diff options
authorTor Arne Vestbø <>2013-10-08 19:41:16 +0200
committerThe Qt Project <>2013-10-25 20:50:51 +0200
commitc760d2dbfdaf743052be620f58c1f123420e9086 (patch)
tree40965f1d1b4a655b81605dd617b391e21e7925eb /tools
parent25650923b10bfd9a5f6b7c05c365eeb602023357 (diff)
Rewrite qmake's exclusive-build feature
We used to compute the default exclusive build directory, eg 'debug', at configure time, and then set OBJECTS_DIR, MOC_DIR, etc to include this hard-coded default exclusive build directory. We then had to run a post- process step where we replaced the 'debug' part with the current actual exclusive build pass, eg 'release', resulting in long-standing bugs such as QTBUG-491 where we end up replacing parts of the build output dirs that were not part of the original exclusive build directory. We now set the OBJECTS_DIR, MOC_DIR, etc defaults in configure like before, but they do not include any exclusive-build information. The exclusive build directory is handled as a separate step in default_post where we adjust all entries in QMAKE_DIR_REPLACE to be exclusive directories. For backwards compatibility the new exclusive build behavior is only enabled for variables named by QMAKE_DIR_REPLACE_SANE, which for Qt itself applies globally to everything but DESTDIR, and for libs and tools also applies to DESTDIR. The reason for leaving out DESTDIR in the general case is because many tests and examples assume the old behavior for DESTDIR. A side effect of including all the other variables for Qt libs and tools is that the PCH output dir will be uniformly set, which has been an issue on Windows in the past. The addExclusiveBuilds function now takes two or more arguments, each argument being the key for an exclusive build, which can be customized eg. using $$key.{name,target,dir_affix}. Passing more than two arguments results in three/four/etc-way exclusive builds, eg debug/release/profile. Exclusive builds can also be combined, eg static/shared + debug/release by making two calls to the function. We also handle individual targets of combined exclusive builds, eg static/shared + debug/release, meaning it is possible to run 'make debug' to build both static-debug and shared-debug. Task-number: QTBUG-491 Change-Id: I02841dbbd065ac07d413dfb45cfcfe4c013674ac Reviewed-by: Oswald Buddenhagen <>
Diffstat (limited to 'tools')
1 files changed, 0 insertions, 8 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 15c35a630f..cc35b425a6 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2613,7 +2613,6 @@ void Configure::generateOutputVars()
if (dictionary[ "FORCEDEBUGINFO" ] == "yes")
qmakeConfig += "force_debug_info";
qmakeConfig += dictionary[ "BUILD" ];
- dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ];
if (buildParts.isEmpty()) {
buildParts = defaultBuildParts;
@@ -2638,9 +2637,6 @@ void Configure::generateOutputVars()
qmakeVars += "QMAKE_QT_VERSION_OVERRIDE = " + version.left(version.indexOf('.'));
- dictionary[ "QMAKE_OUTDIR" ] += "_shared";
- } else {
- dictionary[ "QMAKE_OUTDIR" ] += "_static";
if (dictionary[ "ACCESSIBILITY" ] == "yes")
@@ -2771,10 +2767,6 @@ void Configure::generateOutputVars()
if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
qtConfig += "rpath";
- qmakeVars += QString("OBJECTS_DIR = ") + formatPath(".obj/" + dictionary["QMAKE_OUTDIR"]);
- qmakeVars += QString("MOC_DIR = ") + formatPath(".moc/" + dictionary["QMAKE_OUTDIR"]);
- qmakeVars += QString("RCC_DIR = ") + formatPath(".rcc/" + dictionary["QMAKE_OUTDIR"]);
if (!qmakeDefines.isEmpty())
qmakeVars += QString("DEFINES += ") + qmakeDefines.join(' ');
if (!qmakeIncludes.isEmpty())