From 1589ce3ce855833a50b4e12c86f2b9b5a83d7b02 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 21 Oct 2016 20:23:07 +0200 Subject: chuck sysroot handling out of ProFileEvaluator qmake doesn't do anything with sysroots at this level, so this code plain does not belong here. sysrootification is used when resolving INCLUDEPATH, which is emulating compiler behavior. this is done by higher-level code. Task-number: QTCREATORBUG-11944 Change-Id: Ia25f0b6ef713e9809d974e3f3e49ba308b8c933f Reviewed-by: Tobias Hunger --- src/shared/proparser/ioutils.h | 4 +++- src/shared/proparser/profileevaluator.cpp | 32 +++++++------------------------ src/shared/proparser/profileevaluator.h | 10 +--------- 3 files changed, 11 insertions(+), 35 deletions(-) (limited to 'src/shared/proparser') diff --git a/src/shared/proparser/ioutils.h b/src/shared/proparser/ioutils.h index f4fd79f32d..d7fc596b0d 100644 --- a/src/shared/proparser/ioutils.h +++ b/src/shared/proparser/ioutils.h @@ -25,6 +25,8 @@ #pragma once +#include "qmake_global.h" + #include QT_BEGIN_NAMESPACE @@ -35,7 +37,7 @@ namespace QMakeInternal { This class provides replacement functionality for QFileInfo, QFile & QDir, as these are abysmally slow. */ -class IoUtils { +class QMAKE_EXPORT IoUtils { public: enum FileType { FileNotFound = 0, diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp index e164a6cebc..ab11f5b6ce 100644 --- a/src/shared/proparser/profileevaluator.cpp +++ b/src/shared/proparser/profileevaluator.cpp @@ -39,7 +39,7 @@ void ProFileEvaluator::initialize() QMakeEvaluator::initStatics(); } -ProFileEvaluator::ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeVfs *vfs, +ProFileEvaluator::ProFileEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeVfs *vfs, QMakeHandler *handler) : d(new QMakeEvaluator(option, parser, vfs, handler)) { @@ -86,29 +86,13 @@ QStringList ProFileEvaluator::values(const QString &variableName, const ProFile return ret; } -QString ProFileEvaluator::sysrootify(const QString &path, const QString &baseDir) const -{ - ProFileGlobals *option = static_cast(d->m_option); -#ifdef Q_OS_WIN - Qt::CaseSensitivity cs = Qt::CaseInsensitive; -#else - Qt::CaseSensitivity cs = Qt::CaseSensitive; -#endif - const bool isHostSystemPath = - option->sysroot.isEmpty() || path.startsWith(option->sysroot, cs) - || path.startsWith(baseDir, cs) || path.startsWith(d->m_outputDir, cs) - || !QFileInfo::exists(option->sysroot + path); - - return isHostSystemPath ? path : option->sysroot + path; -} - QStringList ProFileEvaluator::fixifiedValues( const QString &variable, const QString &baseDirectory, const QString &buildDirectory) const { QStringList result; foreach (const QString &el, values(variable)) { if (IoUtils::isAbsolutePath(el)) { - result << sysrootify(el, baseDirectory); + result << el; } else { QString fn = QDir::cleanPath(baseDirectory + QLatin1Char('/') + el); if (IoUtils::exists(fn)) @@ -125,10 +109,9 @@ QStringList ProFileEvaluator::absolutePathValues( { QStringList result; foreach (const QString &el, values(variable)) { - QString absEl = IoUtils::isAbsolutePath(el) - ? sysrootify(el, baseDirectory) : IoUtils::resolvePath(baseDirectory, el); + QString absEl = IoUtils::resolvePath(baseDirectory, el); if (IoUtils::fileType(absEl) == IoUtils::FileIsDir) - result << QDir::cleanPath(absEl); + result << absEl; } return result; } @@ -141,12 +124,11 @@ QStringList ProFileEvaluator::absoluteFileValues( foreach (const QString &el, pro ? values(variable, pro) : values(variable)) { QString absEl; if (IoUtils::isAbsolutePath(el)) { - const QString elWithSysroot = sysrootify(el, baseDirectory); - if (IoUtils::exists(elWithSysroot)) { - result << QDir::cleanPath(elWithSysroot); + if (IoUtils::exists(el)) { + result << el; goto next; } - absEl = elWithSysroot; + absEl = el; } else { foreach (const QString &dir, searchDirs) { QString fn = dir + QLatin1Char('/') + el; diff --git a/src/shared/proparser/profileevaluator.h b/src/shared/proparser/profileevaluator.h index 59285bea25..dd016c0911 100644 --- a/src/shared/proparser/profileevaluator.h +++ b/src/shared/proparser/profileevaluator.h @@ -40,12 +40,6 @@ class QMakeParser; class QMakeEvaluator; class QMakeHandler; -class QMAKE_EXPORT ProFileGlobals : public QMakeGlobals -{ -public: - QString sysroot; -}; - class QMAKE_EXPORT ProFileEvaluator { public: @@ -62,7 +56,7 @@ public: // Call this from a concurrency-free context static void initialize(); - ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeVfs *vfs, + ProFileEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeVfs *vfs, QMakeHandler *handler); ~ProFileEvaluator(); @@ -91,8 +85,6 @@ public: QString propertyValue(const QString &val) const; private: - QString sysrootify(const QString &path, const QString &baseDir) const; - QMakeEvaluator *d; }; -- cgit v1.2.3