Allow checking for the existence of modules in configure.json
You can now use 'module.gui' to check whether the Qt Gui module exists in the current build of Qt. Task-number: QTBUG-56656 Change-Id: Ic73f162ed0578e07c70e3ec3706f285b6d09a41d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>bb10
parent
aeb2768a7c
commit
6de11782d0
|
|
@ -932,6 +932,15 @@ defineTest(qtRunSingleTest) {
|
|||
qtConfSaveResult($${tpfx}, $$1)
|
||||
}
|
||||
|
||||
defineTest(qtConfHaveModule) {
|
||||
module = $$replace(1, -, _)
|
||||
!isEmpty(QT.$${module}.skip):$$eval(QT.$${module}.skip): \
|
||||
return(false)
|
||||
!isEmpty(QT.$${module}.name): \
|
||||
return(true)
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineReplace(qtConfEvaluate) {
|
||||
isEmpty(1): return(true)
|
||||
|
||||
|
|
@ -1015,6 +1024,10 @@ defineReplace(qtConfEvaluateSingleExpression) {
|
|||
var = $$replace(e, "^config\.", "")
|
||||
result = false
|
||||
contains(CONFIG, $$var): result = true
|
||||
} else: contains(e, "^module\..*") {
|
||||
var = $$replace(e, "^module\.", "")
|
||||
result = false
|
||||
qtConfHaveModule($$var): result = true
|
||||
} else: contains(e, "^arch\..*") {
|
||||
var = $$replace(e, "^arch\.", "")
|
||||
result = false
|
||||
|
|
@ -1183,6 +1196,17 @@ defineTest(qtConfCheckFeature) {
|
|||
return(true)
|
||||
}
|
||||
|
||||
defineTest(qtConfCheckModuleCondition) {
|
||||
QT.$${currentModule}.skip = false
|
||||
!$$qtConfEvaluate($$eval($${currentConfig}.condition)): \
|
||||
QT.$${currentModule}.skip = true
|
||||
export(QT.$${currentModule}.skip)
|
||||
|
||||
# ensure qtConfHaveModule() works
|
||||
QT.$${currentModule}.name = -
|
||||
export(QT.$${currentModule}.name)
|
||||
}
|
||||
|
||||
|
||||
defineTest(qtConfProcessFeatures) {
|
||||
for (feature, $${currentConfig}.features._KEYS_): \
|
||||
|
|
@ -1758,15 +1782,28 @@ for (currentConfig, allConfigs) {
|
|||
}
|
||||
}
|
||||
|
||||
# process all features
|
||||
qtConfProcessFeatures()
|
||||
qtConfCheckModuleCondition()
|
||||
|
||||
qtConfHaveModule($$currentModule) {
|
||||
# process all features
|
||||
qtConfProcessFeatures()
|
||||
} else {
|
||||
qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}.skip", "true")
|
||||
}
|
||||
|
||||
# generate files and reports
|
||||
qtConfProcessOutput()
|
||||
qtConfCreateReport()
|
||||
qtConfCreateSummary()
|
||||
qtConfHaveModule($$currentModule) {
|
||||
qtConfCreateReport()
|
||||
qtConfCreateSummary()
|
||||
} else {
|
||||
QT_CONFIGURE_SKIPPED_MODULES += " $$currentModule"
|
||||
}
|
||||
}
|
||||
|
||||
!isEmpty(QT_CONFIGURE_SKIPPED_MODULES): \
|
||||
qtConfAddNote("The following modules are not being compiled in this configuration:" $$QT_CONFIGURE_SKIPPED_MODULES)
|
||||
|
||||
# these come from the pri files loaded above.
|
||||
for (p, QMAKE_POST_CONFIGURE): \
|
||||
eval($$p)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ exists($$OUT_PWD/qt$${MODULE}-config.pri) {
|
|||
CONFIG += generated_privates
|
||||
}
|
||||
|
||||
skip = $$eval(QT.$${MODULE}.skip)
|
||||
isEmpty(skip): skip = false
|
||||
requires(!$$skip)
|
||||
|
||||
# Compile as shared/DLL or static according to the option given to configure
|
||||
# unless overridden. Host builds are always static
|
||||
host_build|staticlib: CONFIG += static
|
||||
|
|
|
|||
Loading…
Reference in New Issue