From 45828fdc323745aefb2bfc145c46b58dd7305241 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 2 Jul 2014 13:42:18 +0200 Subject: read Qt.core defines from Qt build We now read the defines needed for Qt.core from the Qt build instead of calculating them. This also enables us to remove the namespace property from Qt.core. Change-Id: I92bb20f3677eb2012a390f93cb2f047c616e7429 Reviewed-by: Christian Kandeler --- src/lib/qtprofilesetup/qtprofilesetup.cpp | 12 +++++++++--- src/lib/qtprofilesetup/templates/core.qbs | 5 +---- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/lib/qtprofilesetup/qtprofilesetup.cpp b/src/lib/qtprofilesetup/qtprofilesetup.cpp index ea7c26246..ed9fcb8e6 100644 --- a/src/lib/qtprofilesetup/qtprofilesetup.cpp +++ b/src/lib/qtprofilesetup/qtprofilesetup.cpp @@ -221,8 +221,15 @@ static QStringList qt4ModuleIncludePaths(const QtEnvironment &qtEnvironment, static QList qt4Modules(const QtEnvironment &qtEnvironment) { // as per http://qt-project.org/doc/qt-4.8/modules.html + private stuff. - QList modules = QList() - << QtModuleInfo(QLatin1String("QtCore"), QLatin1String("core")) + QList modules; + + QtModuleInfo core(QLatin1String("QtCore"), QLatin1String("core")); + core.compilerDefines << QLatin1String("QT_CORE_LIB"); + if (!qtEnvironment.qtNameSpace.isEmpty()) + core.compilerDefines << QLatin1String("QT_NAMESPACE=") + qtEnvironment.qtNameSpace; + + modules = QList() + << core << QtModuleInfo(QLatin1String("QtCore"), QLatin1String("core-private"), QStringList() << QLatin1String("core")) << QtModuleInfo(QLatin1String("QtGui"), QLatin1String("gui")) @@ -540,7 +547,6 @@ void doSetupQtProfile(const QString &profileName, Settings *settings, profile.setValue(settingsTemplate.arg("mkspecPath"), qtEnvironment.mkspecPath); profile.setValue(settingsTemplate.arg("docPath"), qtEnvironment.documentationPath); profile.setValue(settingsTemplate.arg("version"), qtEnvironment.qtVersion); - profile.setValue(settingsTemplate.arg("namespace"), qtEnvironment.qtNameSpace); profile.setValue(settingsTemplate.arg("libInfix"), qtEnvironment.qtLibInfix); profile.setValue(settingsTemplate.arg("buildVariant"), qtEnvironment.buildVariant); profile.setValue(settingsTemplate.arg(QLatin1String("staticBuild")), staticBuild); diff --git a/src/lib/qtprofilesetup/templates/core.qbs b/src/lib/qtprofilesetup/templates/core.qbs index 13f3ed554..ee67d0ee4 100644 --- a/src/lib/qtprofilesetup/templates/core.qbs +++ b/src/lib/qtprofilesetup/templates/core.qbs @@ -9,7 +9,6 @@ Module { Depends { name: "cpp" } - property string namespace property string libInfix: "" property stringList config property stringList qtConfig @@ -43,13 +42,11 @@ Module { property string libraryInfix: cpp.debugInformation ? 'd' : '' cpp.defines: { - var defines = ["QT_CORE_LIB"]; + var defines = @defines@; // ### QT_NO_DEBUG must be added if the current build variant is derived // from the build variant "release" if (!qbs.debugInformation) defines.push("QT_NO_DEBUG"); - if (namespace) - defines.push("QT_NAMESPACE=" + namespace); if (qbs.targetOS.contains("ios")) defines = defines.concat(["DARWIN_NO_CARBON", "QT_NO_CORESERVICES", "QT_NO_PRINTER", "QT_NO_PRINTDIALOG", "main=qt_main"]); -- cgit v1.2.3