add configure -list-libraries

currently mostly for debugging purposes (especially with -verbose).

Change-Id: I8af32c61df0b19861aa79bc4bbdd3f6095dbe9b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Oswald Buddenhagen 2017-02-08 19:38:31 +01:00
parent 7509ccc0f7
commit 5f20954291
3 changed files with 40 additions and 1 deletions

View File

@ -67,6 +67,8 @@ Configure meta:
-list-features ....... List available features. Note that some features
have dedicated command line options as well.
-list-libraries ...... List possible external dependencies.
Build options:
-opensource .......... Build the Open-Source Edition of Qt

View File

@ -14,7 +14,8 @@
"redo": { "type": "redo" },
"list-features": "void"
"list-features": "void",
"list-libraries": "void"
}
}
}

View File

@ -413,6 +413,10 @@ defineTest(qtConfSetupLibraries) {
isEmpty(alias): alias = $$l
$${lpfx}.alias = $$alias
export($${lpfx}.alias)
# make it easy to refer to the library by its export name.
$${currentConfig}.exports._KEYS_ += $$alias
$${currentConfig}.exports.$$alias += $$l
export($${currentConfig}.exports.$$alias)
isEmpty($${lpfx}.sources._KEYS_): \
error("Library $$l defines no sources")
for (s, $${lpfx}.sources._KEYS_) {
@ -432,6 +436,8 @@ defineTest(qtConfSetupLibraries) {
}
}
}
$${currentConfig}.exports._KEYS_ = $$unique($${currentConfig}.exports._KEYS_)
export($${currentConfig}.exports._KEYS_)
# reverse mapping for assignments on command line.
for (a, $${currentConfig}.commandline.assignments._KEYS_) {
@ -1801,6 +1807,36 @@ qtConfCheckErrors()
error()
}
!isEmpty(config.input.list-libraries) {
logn()
for (currentConfig, allConfigs) {
!isEmpty($${currentConfig}.exports._KEYS_) {
!isEmpty($${currentConfig}.module): \
logn($$eval($${currentConfig}.module):)
else: \
logn($$section(currentConfig, ., -1):)
all_xp =
for (xport, $${currentConfig}.exports._KEYS_) {
libs = $$eval($${currentConfig}.exports.$$xport)
isEqual($${currentConfig}.libraries.$$first(libs).export, "") { # not isEmpty()!
!isEmpty(config.input.verbose): \
all_xp += "$$xport!"
} else {
out = "$$xport"
!isEmpty(config.input.verbose):!isEqual(xport, $$libs): \
out += "($$libs)"
all_xp += "$$out"
}
}
all_xp = $$sorted(all_xp)
all_xp ~= s,^([^!]*)!$,(\\1),g
for (xp, all_xp): \
logn(" $$xp")
}
}
error()
}
for (currentConfig, allConfigs) {
qtConfSetModuleName()
qtConfSetupModuleOutputs()