factor out QMAKE_USE* processing to a separate prf file

this makes it possible for features added via CONFIG to use QMAKE_USE*,
as default_post.prf is processed before all features in CONFIG.

Change-Id: Id0812a0fb1aa5e658548bd2bc6003234085545e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-09-29 17:48:38 +02:00
parent 0059bf944d
commit 1e97037ed9
3 changed files with 23 additions and 24 deletions

View File

@ -116,29 +116,6 @@ c++11|c++14|c++1z {
unset(cxxstd) unset(cxxstd)
} }
suffix =
for(ever) {
QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix})
for(name, QMAKE_USE$${suffix}) {
nu = $$upper($$name)
CONFIG(debug, debug|release): \
libs = $$eval(QMAKE_LIBS_$${nu}_DEBUG)
else: \
libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE)
libs += $$eval(QMAKE_LIBS_$$nu)
cflags = $$eval(QMAKE_CFLAGS_$${nu})
isEmpty(libs):isEmpty(cflags): \
error("Library '$$name' is not defined.")
LIBS$${suffix} += $$libs
QMAKE_CFLAGS += $$cflags
QMAKE_CXXFLAGS += $$cflags
}
!isEmpty(suffix): break()
suffix = "_PRIVATE"
}
!precompile_header: SOURCES += $$NO_PCH_SOURCES !precompile_header: SOURCES += $$NO_PCH_SOURCES
QMAKE_INCDIR += $$QMAKE_INCDIR_POST QMAKE_INCDIR += $$QMAKE_INCDIR_POST

View File

@ -0,0 +1,22 @@
suffix =
for(ever) {
QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix})
for (name, QMAKE_USE$${suffix}) {
nu = $$upper($$name)
debug: \
libs = $$eval(QMAKE_LIBS_$${nu}_DEBUG)
else: \
libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE)
libs += $$eval(QMAKE_LIBS_$$nu)
cflags = $$eval(QMAKE_CFLAGS_$${nu})
isEmpty(libs):isEmpty(cflags): \
error("Library '$$name' is not defined.")
LIBS$${suffix} += $$libs
QMAKE_CFLAGS += $$cflags
QMAKE_CXXFLAGS += $$cflags
}
!isEmpty(suffix): break()
suffix = "_PRIVATE"
}

View File

@ -51,5 +51,5 @@ equals(QMAKE_HOST.os, Windows) {
QMAKE_SH = sh QMAKE_SH = sh
} }
CONFIG = file_copies qt warn_on release link_prl CONFIG = file_copies qmake_use qt warn_on release link_prl
QT = core gui QT = core gui