forked from qt-creator/qt-creator
move sysroot out of QMakeGlobals
it's a hack which is exclusive to ProFileEvaluator. Change-Id: I86141dc8985330a8a1602ced002545a9eb0a646c Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -930,7 +930,7 @@ void Qt4Project::proFileParseError(const QString &errorMessage)
|
|||||||
QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc)
|
QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
if (!m_qmakeGlobals) {
|
if (!m_qmakeGlobals) {
|
||||||
m_qmakeGlobals = new QMakeGlobals;
|
m_qmakeGlobals = new ProFileGlobals;
|
||||||
m_qmakeGlobalsRefCnt = 0;
|
m_qmakeGlobalsRefCnt = 0;
|
||||||
|
|
||||||
Profile *p;
|
Profile *p;
|
||||||
@@ -978,7 +978,7 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
|
|||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMakeGlobals *Qt4Project::qmakeGlobals()
|
ProFileGlobals *Qt4Project::qmakeGlobals()
|
||||||
{
|
{
|
||||||
return m_qmakeGlobals;
|
return m_qmakeGlobals;
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QMakeGlobals;
|
class ProFileGlobals;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer { class DeploymentData; }
|
namespace ProjectExplorer { class DeploymentData; }
|
||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
/// \internal
|
/// \internal
|
||||||
QtSupport::ProFileReader *createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc = 0);
|
QtSupport::ProFileReader *createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc = 0);
|
||||||
/// \internal
|
/// \internal
|
||||||
QMakeGlobals *qmakeGlobals();
|
ProFileGlobals *qmakeGlobals();
|
||||||
/// \internal
|
/// \internal
|
||||||
void destroyProFileReader(QtSupport::ProFileReader *reader);
|
void destroyProFileReader(QtSupport::ProFileReader *reader);
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ private:
|
|||||||
Internal::Qt4ProjectFiles *m_projectFiles;
|
Internal::Qt4ProjectFiles *m_projectFiles;
|
||||||
|
|
||||||
// cached data during project rescan
|
// cached data during project rescan
|
||||||
QMakeGlobals *m_qmakeGlobals;
|
ProFileGlobals *m_qmakeGlobals;
|
||||||
int m_qmakeGlobalsRefCnt;
|
int m_qmakeGlobalsRefCnt;
|
||||||
|
|
||||||
QTimer m_asyncUpdateTimer;
|
QTimer m_asyncUpdateTimer;
|
||||||
|
@@ -751,7 +751,7 @@ void BaseQtVersion::ensureMkSpecParsed() const
|
|||||||
if (mkspecPath().isEmpty())
|
if (mkspecPath().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QMakeGlobals option;
|
ProFileGlobals option;
|
||||||
option.setProperties(versionInfo());
|
option.setProperties(versionInfo());
|
||||||
ProMessageHandler msgHandler(true);
|
ProMessageHandler msgHandler(true);
|
||||||
ProFileCacheManager::instance()->incRefCount();
|
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)
|
: QMakeParser(ProFileCacheManager::instance()->cache(), this)
|
||||||
, ProFileEvaluator(option, this, this)
|
, ProFileEvaluator(option, this, this)
|
||||||
, m_ignoreLevel(0)
|
, m_ignoreLevel(0)
|
||||||
|
@@ -71,7 +71,7 @@ class QTSUPPORT_EXPORT ProFileReader : public ProMessageHandler, public QMakePar
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProFileReader(QMakeGlobals *option);
|
ProFileReader(ProFileGlobals *option);
|
||||||
~ProFileReader();
|
~ProFileReader();
|
||||||
|
|
||||||
QList<ProFile*> includeFiles() const;
|
QList<ProFile*> includeFiles() const;
|
||||||
|
@@ -63,7 +63,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileN
|
|||||||
return 0;
|
return 0;
|
||||||
Utils::FileName mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
|
Utils::FileName mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
|
||||||
|
|
||||||
QMakeGlobals globals;
|
ProFileGlobals globals;
|
||||||
globals.setProperties(versionInfo);
|
globals.setProperties(versionInfo);
|
||||||
ProMessageHandler msgHandler(true);
|
ProMessageHandler msgHandler(true);
|
||||||
ProFileCacheManager::instance()->incRefCount();
|
ProFileCacheManager::instance()->incRefCount();
|
||||||
|
@@ -44,7 +44,7 @@ void ProFileEvaluator::initialize()
|
|||||||
QMakeEvaluator::initStatics();
|
QMakeEvaluator::initStatics();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProFileEvaluator::ProFileEvaluator(QMakeGlobals *option, QMakeParser *parser,
|
ProFileEvaluator::ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser,
|
||||||
QMakeHandler *handler)
|
QMakeHandler *handler)
|
||||||
: d(new QMakeEvaluator(option, parser, 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
|
QString ProFileEvaluator::sysrootify(const QString &path, const QString &baseDir) const
|
||||||
{
|
{
|
||||||
|
ProFileGlobals *option = static_cast<ProFileGlobals *>(d->m_option);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
Qt::CaseSensitivity cs = Qt::CaseInsensitive;
|
Qt::CaseSensitivity cs = Qt::CaseInsensitive;
|
||||||
#else
|
#else
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive;
|
||||||
#endif
|
#endif
|
||||||
const bool isHostSystemPath =
|
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);
|
|| 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(
|
QStringList ProFileEvaluator::absolutePathValues(
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#define PROFILEEVALUATOR_H
|
#define PROFILEEVALUATOR_H
|
||||||
|
|
||||||
#include "qmake_global.h"
|
#include "qmake_global.h"
|
||||||
|
#include "qmakeglobals.h"
|
||||||
#include "qmakeevaluator.h"
|
#include "qmakeevaluator.h"
|
||||||
#include "proitems.h"
|
#include "proitems.h"
|
||||||
|
|
||||||
@@ -40,11 +41,16 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QMakeGlobals;
|
|
||||||
class QMakeParser;
|
class QMakeParser;
|
||||||
class QMakeEvaluator;
|
class QMakeEvaluator;
|
||||||
class QMakeHandler;
|
class QMakeHandler;
|
||||||
|
|
||||||
|
class QMAKE_EXPORT ProFileGlobals : public QMakeGlobals
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString sysroot;
|
||||||
|
};
|
||||||
|
|
||||||
class QMAKE_EXPORT ProFileEvaluator
|
class QMAKE_EXPORT ProFileEvaluator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -60,7 +66,7 @@ public:
|
|||||||
// Call this from a concurrency-free context
|
// Call this from a concurrency-free context
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
ProFileEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeHandler *handler);
|
ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeHandler *handler);
|
||||||
~ProFileEvaluator();
|
~ProFileEvaluator();
|
||||||
|
|
||||||
ProFileEvaluator::TemplateType templateType() const;
|
ProFileEvaluator::TemplateType templateType() const;
|
||||||
|
@@ -103,7 +103,6 @@ public:
|
|||||||
#ifndef QT_BOOTSTRAPPED
|
#ifndef QT_BOOTSTRAPPED
|
||||||
QProcessEnvironment environment;
|
QProcessEnvironment environment;
|
||||||
#endif
|
#endif
|
||||||
QString sysroot;
|
|
||||||
QString qmake_abslocation;
|
QString qmake_abslocation;
|
||||||
|
|
||||||
QString qmakespec, xqmakespec;
|
QString qmakespec, xqmakespec;
|
||||||
|
@@ -70,7 +70,7 @@ public:
|
|||||||
static EvalHandler evalHandler;
|
static EvalHandler evalHandler;
|
||||||
|
|
||||||
static int evaluate(const QString &fileName, const QString &in_pwd, const QString &out_pwd,
|
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;
|
static QSet<QString> visited;
|
||||||
if (visited.contains(fileName))
|
if (visited.contains(fileName))
|
||||||
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
QMakeGlobals option;
|
ProFileGlobals option;
|
||||||
QString qmake = QString::fromLocal8Bit(qgetenv("TESTREADER_QMAKE"));
|
QString qmake = QString::fromLocal8Bit(qgetenv("TESTREADER_QMAKE"));
|
||||||
if (qmake.isEmpty())
|
if (qmake.isEmpty())
|
||||||
qmake = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake");
|
qmake = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake");
|
||||||
|
Reference in New Issue
Block a user