From 5f209542916065775cdd23415aee4a7dee98e902 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 8 Feb 2017 19:38:31 +0100 Subject: [PATCH] add configure -list-libraries currently mostly for debugging purposes (especially with -verbose). Change-Id: I8af32c61df0b19861aa79bc4bbdd3f6095dbe9b7 Reviewed-by: Lars Knoll --- config_help.txt | 2 ++ mkspecs/features/data/configure.json | 3 ++- mkspecs/features/qt_configure.prf | 36 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/config_help.txt b/config_help.txt index 32bc15412c..8a9db24fae 100644 --- a/config_help.txt +++ b/config_help.txt @@ -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 diff --git a/mkspecs/features/data/configure.json b/mkspecs/features/data/configure.json index c4e33d0188..38623d46a4 100644 --- a/mkspecs/features/data/configure.json +++ b/mkspecs/features/data/configure.json @@ -14,7 +14,8 @@ "redo": { "type": "redo" }, - "list-features": "void" + "list-features": "void", + "list-libraries": "void" } } } diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 5c895bcde3..1f8439a81d 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -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()