From 267e572842b9bb7f37a2e778f1d957eeeadad64a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Date: Mon, 18 Jun 2012 19:08:14 +0200 Subject: [PATCH] use real qmakespec as basis for finding features follow suit with qmake ... Change-Id: Ibc5a97703af1c5f57149b6a5feab16215bc7f9e7 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> --- src/shared/proparser/qmakeevaluator.cpp | 13 +++++++------ src/shared/proparser/qmakeevaluator.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index 59a6b039c36..bf615955e0c 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -173,6 +173,7 @@ void QMakeEvaluator::initFrom(const QMakeEvaluator &other) m_functionDefs = other.m_functionDefs; m_valuemapStack = other.m_valuemapStack; m_qmakespec = other.m_qmakespec; + m_qmakespecFull = other.m_qmakespecFull; m_qmakespecName = other.m_qmakespecName; m_featureRoots = other.m_featureRoots; } @@ -1072,15 +1073,15 @@ bool QMakeEvaluator::loadSpec() return false; } #ifdef Q_OS_UNIX - QString real_spec = QFileInfo(m_qmakespec).canonicalFilePath(); + m_qmakespecFull = QFileInfo(m_qmakespec).canonicalFilePath(); #else // We can't resolve symlinks as they do on Unix, so configure.exe puts // the source of the qmake.conf at the end of the default/qmake.conf in // the QMAKESPEC_ORIGINAL variable. const ProString &orig_spec = first(ProString("QMAKESPEC_ORIGINAL")); - QString real_spec = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString(); + m_qmakespecFull = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString(); #endif - m_qmakespecName = IoUtils::fileName(real_spec).toString(); + m_qmakespecName = IoUtils::fileName(m_qmakespecFull).toString(); if (!evaluateFeatureFile(QLatin1String("spec_post.prf"))) return false; // The spec extends the feature search path, so invalidate the cache. @@ -1266,12 +1267,12 @@ QStringList QMakeEvaluator::qmakeFeaturePaths() const foreach (const QString &item, m_option->getPathListEnv(QLatin1String("QMAKEPATH"))) feature_bases << (item + mkspecs_concat); - if (!m_qmakespec.isEmpty()) { + if (!m_qmakespecFull.isEmpty()) { // The spec is already platform-dependent, so no subdirs here. - feature_roots << (m_qmakespec + features_concat); + feature_roots << (m_qmakespecFull + features_concat); // Also check directly under the root directory of the mkspecs collection - QDir specdir(m_qmakespec); + QDir specdir(m_qmakespecFull); while (!specdir.isRoot() && specdir.cdUp()) { const QString specpath = specdir.path(); if (specpath.endsWith(mkspecs_concat)) { diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index 6452101259d..702213274a9 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -199,6 +199,7 @@ public: int m_listCount; QString m_qmakespec; + QString m_qmakespecFull; QString m_qmakespecName; QString m_superfile; QString m_conffile; -- GitLab