Commit 475fe8ec authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

move sysroot out of QMakeGlobals



it's a hack which is exclusive to ProFileEvaluator.

Change-Id: I86141dc8985330a8a1602ced002545a9eb0a646c
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent f8b33bdd
......@@ -930,7 +930,7 @@ void Qt4Project::proFileParseError(const QString &errorMessage)
QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc)
{
if (!m_qmakeGlobals) {
m_qmakeGlobals = new QMakeGlobals;
m_qmakeGlobals = new ProFileGlobals;
m_qmakeGlobalsRefCnt = 0;
Profile *p;
......@@ -978,7 +978,7 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
return reader;
}
QMakeGlobals *Qt4Project::qmakeGlobals()
ProFileGlobals *Qt4Project::qmakeGlobals()
{
return m_qmakeGlobals;
}
......
......@@ -43,7 +43,7 @@
#include <QFuture>
QT_BEGIN_NAMESPACE
class QMakeGlobals;
class ProFileGlobals;
QT_END_NAMESPACE
namespace ProjectExplorer { class DeploymentData; }
......@@ -105,7 +105,7 @@ public:
/// \internal
QtSupport::ProFileReader *createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc = 0);
/// \internal
QMakeGlobals *qmakeGlobals();
ProFileGlobals *qmakeGlobals();
/// \internal
void destroyProFileReader(QtSupport::ProFileReader *reader);
......@@ -194,7 +194,7 @@ private:
Internal::Qt4ProjectFiles *m_projectFiles;
// cached data during project rescan
QMakeGlobals *m_qmakeGlobals;
ProFileGlobals *m_qmakeGlobals;
int m_qmakeGlobalsRefCnt;
QTimer m_asyncUpdateTimer;
......
......@@ -751,7 +751,7 @@ void BaseQtVersion::ensureMkSpecParsed() const
if (mkspecPath().isEmpty())
return;
QMakeGlobals option;
ProFileGlobals option;
option.setProperties(versionInfo());
ProMessageHandler msgHandler(true);
ProFileCacheManager::instance()->incRefCount();
......
......@@ -68,7 +68,7 @@ void ProMessageHandler::fileMessage(const QString &)
}
ProFileReader::ProFileReader(QMakeGlobals *option)
ProFileReader::ProFileReader(ProFileGlobals *option)
: QMakeParser(ProFileCacheManager::instance()->cache(), this)
, ProFileEvaluator(option, this, this)
, m_ignoreLevel(0)
......
......@@ -71,7 +71,7 @@ class QTSUPPORT_EXPORT ProFileReader : public ProMessageHandler, public QMakePar
Q_OBJECT
public:
ProFileReader(QMakeGlobals *option);
ProFileReader(ProFileGlobals *option);
~ProFileReader();
QList<ProFile*> includeFiles() const;
......
......@@ -63,7 +63,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileN
return 0;
Utils::FileName mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
QMakeGlobals globals;
ProFileGlobals globals;
globals.setProperties(versionInfo);
ProMessageHandler msgHandler(true);
ProFileCacheManager::instance()->incRefCount();
......
......@@ -44,7 +44,7 @@ void ProFileEvaluator::initialize()
QMakeEvaluator::initStatics();
}
ProFileEvaluator::ProFileEvaluator(QMakeGlobals *option, QMakeParser *parser,
ProFileEvaluator::ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser,
QMakeHandler *handler)
: d(new QMakeEvaluator(option, parser, handler))
{
......@@ -93,16 +93,17 @@ QStringList ProFileEvaluator::values(const QString &variableName, const ProFile
QString ProFileEvaluator::sysrootify(const QString &path, const QString &baseDir) const
{
ProFileGlobals *option = static_cast<ProFileGlobals *>(d->m_option);
#ifdef Q_OS_WIN
Qt::CaseSensitivity cs = Qt::CaseInsensitive;
#else
Qt::CaseSensitivity cs = Qt::CaseSensitive;
#endif
const bool isHostSystemPath =
d->m_option->sysroot.isEmpty() || path.startsWith(d->m_option->sysroot, cs)
option->sysroot.isEmpty() || path.startsWith(option->sysroot, cs)
|| path.startsWith(baseDir, cs) || path.startsWith(d->m_outputDir, cs);
return isHostSystemPath ? path : d->m_option->sysroot + path;
return isHostSystemPath ? path : option->sysroot + path;
}
QStringList ProFileEvaluator::absolutePathValues(
......
......@@ -32,6 +32,7 @@
#define PROFILEEVALUATOR_H
#include "qmake_global.h"
#include "qmakeglobals.h"
#include "qmakeevaluator.h"
#include "proitems.h"
......@@ -40,11 +41,16 @@
QT_BEGIN_NAMESPACE
class QMakeGlobals;
class QMakeParser;
class QMakeEvaluator;
class QMakeHandler;
class QMAKE_EXPORT ProFileGlobals : public QMakeGlobals
{
public:
QString sysroot;
};
class QMAKE_EXPORT ProFileEvaluator
{
public:
......@@ -60,7 +66,7 @@ public:
// Call this from a concurrency-free context
static void initialize();
ProFileEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeHandler *handler);
ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeHandler *handler);
~ProFileEvaluator();
ProFileEvaluator::TemplateType templateType() const;
......
......@@ -103,7 +103,6 @@ public:
#ifndef QT_BOOTSTRAPPED
QProcessEnvironment environment;
#endif
QString sysroot;
QString qmake_abslocation;
QString qmakespec, xqmakespec;
......
......@@ -70,7 +70,7 @@ public:
static EvalHandler evalHandler;
static int evaluate(const QString &fileName, const QString &in_pwd, const QString &out_pwd,
bool cumulative, QMakeGlobals *option, QMakeParser *parser, int level)
bool cumulative, ProFileGlobals *option, QMakeParser *parser, int level)
{
static QSet<QString> visited;
if (visited.contains(fileName))
......@@ -143,7 +143,7 @@ int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QMakeGlobals option;
ProFileGlobals option;
QString qmake = QString::fromLocal8Bit(qgetenv("TESTREADER_QMAKE"));
if (qmake.isEmpty())
qmake = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment