c760d2dbfd
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 <oswald.buddenhagen@digia.com>
57 lines
1.4 KiB
Plaintext
57 lines
1.4 KiB
Plaintext
#
|
|
# W A R N I N G
|
|
# -------------
|
|
#
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
# implementation detail. It may change from version to version
|
|
# without notice, or even be removed.
|
|
#
|
|
# We mean it.
|
|
#
|
|
|
|
staticlib: \
|
|
CONFIG += static
|
|
else: dll: \
|
|
CONFIG += shared
|
|
|
|
CONFIG(static, static|shared) {
|
|
CONFIG -= shared dll
|
|
contains(TEMPLATE, ".*lib"): CONFIG += staticlib
|
|
} else {
|
|
CONFIG -= static staticlib
|
|
contains(TEMPLATE, ".*lib"): CONFIG += dll
|
|
}
|
|
|
|
!macx-xcode: \
|
|
addExclusiveBuilds(shared, static)
|
|
|
|
CONFIG(debug, debug|release): \
|
|
CONFIG -= release
|
|
else: \
|
|
CONFIG -= debug
|
|
|
|
!macx-xcode {
|
|
addExclusiveBuilds(debug, release)
|
|
} else {
|
|
# The Xcode generator always generates project files with
|
|
# debug and release configurations, regardless of whether
|
|
# or not debug_and_release is active.
|
|
for(build, $$list(debug release)) {
|
|
suffix =
|
|
contains(QT_CONFIG, debug_and_release) {
|
|
equals(build, debug): \
|
|
suffix = _debug
|
|
} else {
|
|
contains(QT_CONFIG, debug): \
|
|
suffix = _debug
|
|
}
|
|
|
|
library_suffix_$${build}.name = $$QMAKE_XCODE_LIBRARY_SUFFIX_SETTING
|
|
library_suffix_$${build}.value = $$suffix
|
|
library_suffix_$${build}.build = $$build
|
|
QMAKE_MAC_XCODE_SETTINGS += library_suffix_$${build}
|
|
|
|
CONFIG *= xcode_dynamic_library_suffix
|
|
}
|
|
}
|