From 1a43199fcea1bcec1ebf1a1a12cd3dcb942d67b4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 8 Nov 2016 18:50:54 +0100 Subject: [PATCH] configure: turn qtConfOutputPostProcess_*() callbacks into replace functions now the callbacks don't need to re-export the designated file contents, which improves the abstraction and removes some boilerplate. Change-Id: Ifa50313155fc96762025e2610b810ebb71daa373 Reviewed-by: Lars Knoll --- configure.pri | 12 ++++++------ mkspecs/features/qt_configure.prf | 14 +++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/configure.pri b/configure.pri index 0e6bb6a6f57..19719736a9b 100644 --- a/configure.pri +++ b/configure.pri @@ -457,9 +457,10 @@ defineTest(qtConfOutput_qmakeArgs) { export($${currentConfig}.output.privatePro) } -defineTest(qtConfOutputPostProcess_publicPro) { +defineReplace(qtConfOutputPostProcess_publicPro) { qt_version = $$[QT_VERSION] output = \ + $$1 \ "QT_VERSION = $$qt_version" \ "QT_MAJOR_VERSION = $$section(qt_version, '.', 0, 0)" \ "QT_MINOR_VERSION = $$section(qt_version, '.', 1, 1)" \ @@ -476,13 +477,13 @@ defineTest(qtConfOutputPostProcess_publicPro) { "QT_RELEASE_DATE = $$config.input.qt_release_date" } - $${currentConfig}.output.publicPro += $$output - export($${currentConfig}.output.publicPro) + return($$output) } -defineTest(qtConfOutputPostProcess_publicHeader) { +defineReplace(qtConfOutputPostProcess_publicHeader) { qt_version = $$[QT_VERSION] output = \ + $$1 \ "$${LITERAL_HASH}define QT_VERSION_STR \"$$qt_version\"" \ "$${LITERAL_HASH}define QT_VERSION_MAJOR $$section(qt_version, '.', 0, 0)" \ "$${LITERAL_HASH}define QT_VERSION_MINOR $$section(qt_version, '.', 1, 1)" \ @@ -499,8 +500,7 @@ defineTest(qtConfOutputPostProcess_publicHeader) { !isEmpty(config.input.qt_libinfix): \ output += "$${LITERAL_HASH}define QT_LIBINFIX \"$$eval(config.input.qt_libinfix)\"" - $${currentConfig}.output.publicHeader += $$output - export($${currentConfig}.output.publicHeader) + return($$output) } diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index c984206f0d9..289e2250bd0 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1672,13 +1672,17 @@ defineTest(qtConfProcessOutput) { } } - ppScope = - !isEmpty(module): ppScope = $${module}_ - defined(qtConfOutputPostProcess_$${ppScope}$${type}, test): \ - qtConfOutputPostProcess_$${ppScope}$${type}() + content = $$eval($${currentConfig}.output.$${type}) + + !isEmpty(module): \ + call = qtConfOutputPostProcess_$${module}_$${type} + else: \ + call = qtConfOutputPostProcess_$${type} + defined($$call, replace): \ + eval(content = \$\$"$$call"(\$\$content)) file = $$eval($${currentConfig}.files.$${type}) - fileCont.$$file += $$eval($${currentConfig}.output.$${type}) + fileCont.$$file += $$content fileCont._KEYS_ *= $$file }