60e5a1c8ef
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>
52 lines
1.4 KiB
Plaintext
52 lines
1.4 KiB
Plaintext
equals(QMAKE_HOST.os, Windows) {
|
|
SETENV_PFX = "set "
|
|
SETENV_SFX = "&"
|
|
} else {
|
|
SETENV_PFX =
|
|
SETENV_SFX =
|
|
}
|
|
|
|
QMAKE_MAKE = $$(MAKE)
|
|
!isEmpty(QMAKE_MAKE) {
|
|
# We were called recursively. Use the same make.
|
|
} else: if(equals(MAKEFILE_GENERATOR, UNIX)|equals(MAKEFILE_GENERATOR, MINGW)) {
|
|
!equals(QMAKE_HOST.os, Windows): \
|
|
QMAKE_MAKE = make
|
|
else: \
|
|
QMAKE_MAKE = mingw32-make
|
|
} else: if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)) {
|
|
QMAKE_MAKE = nmake
|
|
} else {
|
|
error("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.")
|
|
}
|
|
# Make sure we don't inherit MAKEFLAGS - -i in particular is fatal.
|
|
QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE"
|
|
|
|
isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
|
|
|
|
defineTest(qtLog) {
|
|
write_file($$QMAKE_CONFIG_LOG, 1, append)
|
|
$$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)")
|
|
}
|
|
|
|
defineTest(qtRunLoggedCommand) {
|
|
qtLog("+ $$1")
|
|
|
|
output = $$system("( $$1 ) 2>&1", lines, result)
|
|
qtLog($$output)
|
|
!isEmpty(2) {
|
|
$$2 = $$output
|
|
export($$2)
|
|
}
|
|
|
|
!equals(result, 0): return(false)
|
|
return(true)
|
|
}
|
|
|
|
# Ensure that a cache is present. If none was found on startup, this will create
|
|
# one in the build directory of the project which loads this feature.
|
|
cache()
|
|
|
|
QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log
|
|
write_file($$QMAKE_CONFIG_LOG, "")
|