diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-11-08 18:50:54 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-11-15 22:44:41 +0000 |
commit | 1a43199fcea1bcec1ebf1a1a12cd3dcb942d67b4 (patch) | |
tree | f896710939fdc36ffca8e7f4a13700bf1b59229b | |
parent | 4d90bd55a5f330b56ebcd92f56a138dd79cfcef9 (diff) |
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 <lars.knoll@qt.io>
-rw-r--r-- | configure.pri | 12 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 14 |
2 files changed, 15 insertions, 11 deletions
diff --git a/configure.pri b/configure.pri index 0e6bb6a6f5..19719736a9 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 c984206f0d..289e2250bd 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 } |