summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-10-12 11:30:58 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-10-15 18:45:19 +0000
commitcd62d2810ba89243a0f6da43befcd0ebd557c4d8 (patch)
treea1e9f6b0d22d38a2a7944c0386f538b1c73a9213
parent9a088e78690a3052f9c2d7e388e37957c2470ab1 (diff)
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>
-rw-r--r--mkspecs/features/qt.prf2
-rw-r--r--mkspecs/features/qt_module.prf2
-rw-r--r--mkspecs/features/qt_module_pris.prf2
3 files changed, 6 insertions, 0 deletions
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index bd54565e01..fb814b547f 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -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)
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index a89df18f3a..1df41065af 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -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
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index 379f8cdf17..640281b9a9 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -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) \
"" \