From e6d97f3f77b94268edbe2a651476188cdcc8dc5d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 19 Apr 2012 19:21:32 +0200 Subject: [PATCH] support for private depends in modules if a module's private headers add additional dependencies, QT_PRIVATE is now the place to declare them. note however, that this may not contain other private headers in turn - that would be much harder to implement, and we want the explicitness anyway. Change-Id: Ic516fcf1a003c95798df4fbe216f92016afaf47e Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt.prf | 1 + mkspecs/features/qt_module_config.prf | 10 ++++++++++ mkspecs/features/qt_module_fwdpri.prf | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 9414d9fcde..d9422ca1e8 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -146,6 +146,7 @@ for(QTLIB, QT) { want_var = QT.$${QTLIBRAW}.want_private $$want_var = UsePrivate using_privates = true + NEWQT += $$eval(QT.$${QTLIBRAW}.private_depends) } NEWQT += $$QTLIBRAW } diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf index 010c5cae43..5e567143fe 100644 --- a/mkspecs/features/qt_module_config.prf +++ b/mkspecs/features/qt_module_config.prf @@ -42,6 +42,12 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_$${MODULE}.pri !build_pass { # Create a module .pri file + !isEmpty(QT_PRIVATE) { + contains(QT_PRIVATE, .*-private$):error("QT_PRIVATE may not contain *-private.") + module_privdep = "QT.$${MODULE}.private_depends = $$QT_PRIVATE" + } else { + module_privdep = + } staticlib: \ module_build_type = "QT.$${MODULE}.module_config = staticlib" else:mac:!static:contains(QT_CONFIG, qt_framework): \ @@ -72,6 +78,7 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_$${MODULE}.pri "QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \ "QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \ "QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ + $$module_privdep \ $$module_build_type \ $$module_config \ "QT.$${MODULE}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting @@ -110,6 +117,9 @@ if(win32|mac):!wince*:!macx-xcode { linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF +QT += $$QT_PRIVATE +unset(QT_PRIVATE) + !isEmpty(DESTDIR):CONFIG += create_cmake contains(TARGET, QtAddOn.*): \ diff --git a/mkspecs/features/qt_module_fwdpri.prf b/mkspecs/features/qt_module_fwdpri.prf index b6b97b17f4..9de255fc91 100644 --- a/mkspecs/features/qt_module_fwdpri.prf +++ b/mkspecs/features/qt_module_fwdpri.prf @@ -41,7 +41,7 @@ } include($$MODULE_FWD_PRI) for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \ - name depends module_config CONFIG DEFINES sources \ + name depends private_depends module_config CONFIG DEFINES sources \ includes private_includes bins libs plugins imports \ )):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient) cache(QT_CONFIG, transient)