configure: factor out $$qtConfScalarOrList()
we'll need it in more places. Change-Id: Ia7e3d9ea4a27cc01294bde4cafe6721eb9f59343 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
fe9be10b92
commit
6f735b6839
@ -34,6 +34,18 @@ defineTest(qtConfFatalError) {
|
|||||||
error()
|
error()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return a string list for the specified JSON path, which may be either a
|
||||||
|
# single string or an array of strings.
|
||||||
|
# Note that this returns a variable name, so it can be directly iterated over.
|
||||||
|
defineReplace(qtConfScalarOrList) {
|
||||||
|
defined($$1, var): return($$1)
|
||||||
|
vals = $$list()
|
||||||
|
for (i, $${1}._KEYS_): \
|
||||||
|
$$vals += $$eval($${1}.$$i)
|
||||||
|
export($$vals)
|
||||||
|
return($$vals)
|
||||||
|
}
|
||||||
|
|
||||||
defineTest(qtConfCommandlineSetInput) {
|
defineTest(qtConfCommandlineSetInput) {
|
||||||
arg = $${1}
|
arg = $${1}
|
||||||
val = $${2}
|
val = $${2}
|
||||||
@ -1339,20 +1351,13 @@ defineTest(qtConfCheckFeature) {
|
|||||||
} else: !$$enabled:!$$qtConfEvaluate($$eval($${fpfx}.autoDetect)) {
|
} else: !$$enabled:!$$qtConfEvaluate($$eval($${fpfx}.autoDetect)) {
|
||||||
# feature not auto-detected and not explicitly enabled
|
# feature not auto-detected and not explicitly enabled
|
||||||
result = false
|
result = false
|
||||||
} else {
|
|
||||||
condition = $$eval($${fpfx}.condition)
|
|
||||||
!isEmpty(condition) {
|
|
||||||
result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled)
|
|
||||||
} else {
|
} else {
|
||||||
result = true
|
result = true
|
||||||
# check whether we have an array of conditions
|
for (condition, $$qtConfScalarOrList($${fpfx}.condition)) {
|
||||||
for (i, $${fpfx}.condition._KEYS_) {
|
|
||||||
condition = $$eval($${fpfx}.condition.$$i)
|
|
||||||
result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled)
|
result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled)
|
||||||
!$$result: break()
|
!$$result: break()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$${fpfx}.available = $$result
|
$${fpfx}.available = $$result
|
||||||
export($${fpfx}.available)
|
export($${fpfx}.available)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user