qt5base-lts/mkspecs/features/qt_build_config.prf

143 lines
4.4 KiB
Plaintext
Raw Normal View History

#
# 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.
#
!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) {
QMAKE_QT_MODULE = $$[QT_HOST_DATA/get]/mkspecs/qmodule.pri
!exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) {
debug(1, "Cannot load qmodule.pri!")
} else {
debug(1, "Loaded qmodule.pri from ($$QMAKE_QT_MODULE)")
}
} else {
debug(1, "Not loading qmodule.pri twice")
}
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 <oswald.buddenhagen@digia.com>
2013-10-08 17:41:16 +00:00
PRECOMPILED_DIR = .pch
OBJECTS_DIR = .obj
MOC_DIR = .moc
RCC_DIR = .rcc
UI_DIR = .uic
intel_icl {
# ICL 14.0 has a bug that makes it not find #includes in dirs starting with .
MOC_DIR = tmp/moc
RCC_DIR = tmp/rcc
UI_DIR = tmp/uic
}
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 <oswald.buddenhagen@digia.com>
2013-10-08 17:41:16 +00:00
QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR
# force_independent can be set externally. prefix_build not.
!exists($$[QT_HOST_DATA]/.qmake.cache): \
CONFIG += prefix_build force_independent
!build_pass:!isEmpty(_QMAKE_SUPER_CACHE_):force_independent {
# When doing a -prefix build of top-level qt5/qt.pro, we need to announce
# this repo's output dir to the other repos.
MODULE_BASE_OUTDIR = $$shadowed($$dirname(_QMAKE_CONF_))
!contains(QTREPOS, $$MODULE_BASE_OUTDIR): \
cache(QTREPOS, add super, MODULE_BASE_OUTDIR)
# This repo's module pris' location needs to be made known to qmake.
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
modpath = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
!contains(QMAKEMODULES, $$modpath): \
cache(QMAKEMODULES, add super, modpath)
unset(modpath)
}
defineTest(qtSetQmlPath) {
!qtConfig(static)|host_build|no_import_scan: \
return()
deps = $$replace(QT, -private$, _private)
deps = $$resolve_depends(deps, "QT.")
!contains(deps, qml): \
return()
isEmpty(QTREPOS): \
QTREPOS = $$shadowed($$dirname(_QMAKE_CONF_))
for (qrep, QTREPOS): \
exists($$qrep/qml): \
QMLPATHS += $$qrep/qml
export(QMLPATHS)
}
# Apply extra compiler flags passed via configure last.
CONFIG = qt_build_extra $$CONFIG
# Don't actually try to install anything in non-prefix builds.
# This is much easier and safer than making every single INSTALLS
# assignment conditional.
!prefix_build: \
CONFIG += qt_clear_installs
cross_compile: \
CONFIG += force_bootstrap
android|uikit|winrt: \
CONFIG += builtin_testdata
CONFIG += \
utf8_source \
create_prl link_prl \
prepare_docs qt_docs_targets \
no_private_qt_headers_warning QTDIR_build \
qt_example_installs \
# Qt modules get compiled without exceptions enabled by default.
# However, testcases should be still built with exceptions.
exceptions_off testcase_exceptions
# Under Windows, this is neither necessary (transitive deps are automatically
# resolved), nor functional (.res files end up in .prl files and break things).
unix: CONFIG += explicitlib
# By default we want tests on macOS to be built as standalone executables
macos: CONFIG += testcase_no_bundle
# Override MinGW's definition in _mingw.h
mingw: DEFINES += WINVER=0x0601 _WIN32_WINNT=0x0601
defineTest(qtBuildPart) {
bp = $$eval($$upper($$section(_QMAKE_CONF_, /, -2, -2))_BUILD_PARTS)
isEmpty(bp): bp = $$QT_BUILD_PARTS
contains(bp, $$1): return(true)
return(false)
}
defineTest(qtNomakeTools) {
qtBuildPart(tools): return()
for (d, 1) {
$${d}.CONFIG += no_default_target no_default_install
export($${d}.CONFIG)
}
}
Modularize the new configure system (infrastructure part) This change implements the required infrastructure to modularize the new configuration system. This requires a hierarchy of configuration files, both for handling multiple repositories and for individual modules inside the same repository. When configuring, they all need to get loaded first, as command line processing needs to know about all possible command line options. When the command line has been processed, the individual configuration files need to get processed one after the other and independently from each other. Configure is now automatically invoked when building the a project tree's "root" project; this works with both modular and top-level builds of Qt (the latter with an according change in the super repo). As an immediate consequence, the -skip option moves to the super repo with a different implementation, as configuration is now done after the repo list is determined. The option belongs there anyway. This commit also adds an optional testDir entry to the json file. Like this, we can still have all configure tests in qtbase/config.tests and the configuration file in, e.g., corelib can reference those. The files section can now be left out as long as a 'module' entry is present, specifying the module name. The names of the files to generate can then be deduced from that name. We still need to be able to specify names directly for the global configuration files. qtConfig() now also queries features which are module-specific. As it is sometimes necessary to query the configuration of modules which should not be actually linked (and cannot in the case of subdirs projects), the new variable QT_FOR_CONFIG which allows specifying configuration-only dependencies is introduced. Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Change-Id: Id1b518a3aa34044748b87fb8fac14d79653f6b18 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-25 13:45:44 +00:00
# This overloads the same function from qt_functions.prf.
# This is not in qt_module.prf, as that gets loaded too late.
defineTest(qtConfig) {
modules = $$QT $$QT_PRIVATE $$QT_FOR_PRIVATE $$QT_FOR_CONFIG
modules ~= s,-private$,_private,g
modules = $$resolve_depends(modules, "QT.", ".depends")
isEmpty(MODULE): \
MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
exists($$OUT_PWD/qt$${MODULE}-config.pri) {
include($$OUT_PWD/qt$${MODULE}-config.pri)
modules += $${MODULE} $${MODULE}_private
}
modules += global global_private
modules = $$reverse(modules)
for (module, modules) {
contains(QT.$${module}.enabled_features, $$1): \
return(true)
contains(QT.$${module}.disabled_features, $$1): \
return(false)
}
error("Could not find feature $${1}.")
}