qt5base-lts/mkspecs/features/exclusive_builds.prf
Joerg Bornemann 3052e621a4 Fix duplicates in QMAKE_DIR_REPLACE
When building Qt, qt_build_config.prf adds all directory variables but
DESTDIR to QMAKE_DIR_REPLACE_SANE. We must not add the content of
QMAKE_DIR_REPLACE_SANE unconditionally to QMAKE_DIR_REPLACE in order
to avoid duplicate entries.

Duplicate entries result in an interesting build folder structure like

.obj
├───debug
│   └───debug
└───release
    └───release

This commit amends 274882a5.

Change-Id: Ifa8178410d82f58635babc46d43774bab522fbf8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-07-10 12:35:52 +02:00

46 lines
1.2 KiB
Plaintext

defineTest(addExclusiveBuildsProper) {
!$$1:!fix_output_dirs: \
return(true)
for(build, 2) {
isEmpty($${build}.name) {
$${build}.name = $$title($$build)
export($${build}.name)
}
isEmpty($${build}.target) {
$${build}.target = $$lower($$build)
export($${build}.target)
}
isEmpty($${build}.dir_affix) {
$${build}.dir_affix = $$lower($$build)
export($${build}.dir_affix)
}
$${build}.exclusive = $$2
export($${build}.exclusive)
QMAKE_EXCLUSIVE_BUILDS += $$build
}
CONFIG *= exclusive_builds
export(CONFIG)
export(QMAKE_EXCLUSIVE_BUILDS)
return(true)
}
defineTest(addExclusiveBuilds) {
lessThan(ARGC, 2): \
error("addExclusiveBuilds() requires at least two arguments")
addExclusiveBuildsProper($$join(ARGS, _and_), $$ARGS)
}
QMAKE_DEFAULT_DIRS_TO_PROCESS = QGLTF_DIR TRACEGEN_DIR QMLCACHE_DIR LRELEASE_DIR LEX_DIR YACC_DIR
QMAKE_DIR_REPLACE_SANE += $$QMAKE_DEFAULT_DIRS_TO_PROCESS
QMAKE_DIR_REPLACE = \
OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR \
$$QMAKE_DEFAULT_DIRS_TO_PROCESS
unset(QMAKE_DEFAULT_DIRS_TO_PROCESS)