make users of qt modules inherit the modules' public QMAKE_USE

when a module makes an external dependency part of its api, the users of
that module need to know the include paths (and possibly defines) of
that dependency, and also need to link to it explicitly if they want to
access symbols from it directly.
this patch implements this via the usual qt module pri mechanism.

limitation: the external library definitions are in the private pris,
so technically a public module is not allowed to make its external
dependencies public. we don't have (and don't anticipate) such a case.

Change-Id: I2dbbdcfcfc1b200acae151a969976cd668e24f89
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-10-12 11:30:58 +02:00 committed by Oswald Buddenhagen
parent 9a088e7869
commit cd62d2810b
3 changed files with 6 additions and 0 deletions

View File

@ -71,6 +71,7 @@ for(ever) {
MODULE_INCLUDES = $$eval(QT.$${QTLIB}.includes)
MODULE_LIBS = $$eval(QT.$${QTLIB}.libs)
MODULE_FRAMEWORKS = $$eval(QT.$${QTLIB}.frameworks)
MODULE_USES = $$eval(QT.$${QTLIB}.uses)
MODULE_CONFIG = $$eval(QT.$${QTLIB}.module_config)
isEmpty(MODULE_NAME) {
@ -141,6 +142,7 @@ for(ever) {
}
}
}
QMAKE_USE$$var_sfx += $$MODULE_USES
# Add capabilities as defined by modules used in the project
winrt {
MODULE_WINRT_CAPABILITIES = $$eval(QT.$${QTLIB}.winrt_capabilities)

View File

@ -93,6 +93,8 @@ QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
QT += $$QT_FOR_PRIVATE
unset(QT_FOR_PRIVATE)
QMAKE_USE_PRIVATE += $$QMAKE_USE_FOR_PRIVATE
unset(QMAKE_USE_FOR_PRIVATE)
!internal_module:CONFIG += create_cmake

View File

@ -131,6 +131,7 @@ defineReplace(qtExportLibsForModule) {
MODULE_PRI_CONT += \
"QT.$${MODULE_ID}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
$$module_rundep \
"QT.$${MODULE_ID}.uses =$$join(QMAKE_USE, " ", " ")" \
"QT.$${MODULE_ID}.module_config =$$join(module_build_type, " ", " ")" \
$$module_config \
"QT.$${MODULE_ID}.DEFINES = $$val_escape(MODULE_DEFINES)" \
@ -161,6 +162,7 @@ defineReplace(qtExportLibsForModule) {
"QT.$${MODULE}_private.includes = $$MODULE_PRIVATE_INCLUDES" \
"QT.$${MODULE}_private.frameworks =" \
"QT.$${MODULE}_private.depends = $$private_deps" \
"QT.$${MODULE}_private.uses =$$join(QMAKE_USE_FOR_PRIVATE, " ", " ")" \
"QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")" \
$$qtGetFeaturesForModule($${MODULE}_private) \
"" \