forked from qt-creator/qt-creator
ProFileOption => QMakeGlobals
more accurate class name Change-Id: I4258b221727e79cc88d5f57dd1f6631ba0bba625 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -1973,7 +1973,7 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
|
|||||||
|
|
||||||
// update TargetInformation
|
// update TargetInformation
|
||||||
m_qt4targetInformation = targetInformation(m_readerExact);
|
m_qt4targetInformation = targetInformation(m_readerExact);
|
||||||
m_resolvedMkspecPath = m_project->proFileOption()->qmakespec;
|
m_resolvedMkspecPath = m_project->qmakeGlobals()->qmakespec;
|
||||||
|
|
||||||
m_subProjectsNotToDeploy = subProjectsNotToDeploy;
|
m_subProjectsNotToDeploy = subProjectsNotToDeploy;
|
||||||
setupInstallsList(m_readerExact);
|
setupInstallsList(m_readerExact);
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
|
|||||||
m_nodesWatcher(new Internal::Qt4NodesWatcher(this)),
|
m_nodesWatcher(new Internal::Qt4NodesWatcher(this)),
|
||||||
m_fileInfo(new Qt4ProjectFile(fileName, this)),
|
m_fileInfo(new Qt4ProjectFile(fileName, this)),
|
||||||
m_projectFiles(new Qt4ProjectFiles),
|
m_projectFiles(new Qt4ProjectFiles),
|
||||||
m_proFileOption(0),
|
m_qmakeGlobals(0),
|
||||||
m_asyncUpdateFutureInterface(0),
|
m_asyncUpdateFutureInterface(0),
|
||||||
m_pendingEvaluateFuturesCount(0),
|
m_pendingEvaluateFuturesCount(0),
|
||||||
m_asyncUpdateState(NoState),
|
m_asyncUpdateState(NoState),
|
||||||
@@ -916,9 +916,9 @@ void Qt4Project::proFileParseError(const QString &errorMessage)
|
|||||||
|
|
||||||
QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc)
|
QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
if (!m_proFileOption) {
|
if (!m_qmakeGlobals) {
|
||||||
m_proFileOption = new ProFileOption;
|
m_qmakeGlobals = new QMakeGlobals;
|
||||||
m_proFileOptionRefCnt = 0;
|
m_qmakeGlobalsRefCnt = 0;
|
||||||
|
|
||||||
Profile *p;
|
Profile *p;
|
||||||
Utils::Environment env = Utils::Environment::systemEnvironment();
|
Utils::Environment env = Utils::Environment::systemEnvironment();
|
||||||
@@ -931,7 +931,7 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
|
|||||||
env = bc->environment();
|
env = bc->environment();
|
||||||
if (bc->qmakeStep()) {
|
if (bc->qmakeStep()) {
|
||||||
qmakeArgs = bc->qmakeStep()->parserArguments();
|
qmakeArgs = bc->qmakeStep()->parserArguments();
|
||||||
m_proFileOption->qmakespec = bc->qmakeStep()->mkspec().toString();
|
m_qmakeGlobals->qmakespec = bc->qmakeStep()->mkspec().toString();
|
||||||
} else {
|
} else {
|
||||||
qmakeArgs = bc->configCommandLineArguments();
|
qmakeArgs = bc->configCommandLineArguments();
|
||||||
}
|
}
|
||||||
@@ -944,43 +944,43 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
|
|||||||
? SysRootProfileInformation::sysRoot(p).toString() : QString();
|
? SysRootProfileInformation::sysRoot(p).toString() : QString();
|
||||||
|
|
||||||
if (qtVersion && qtVersion->isValid())
|
if (qtVersion && qtVersion->isValid())
|
||||||
m_proFileOption->properties = qtVersion->versionInfo();
|
m_qmakeGlobals->properties = qtVersion->versionInfo();
|
||||||
m_proFileOption->sysroot = systemRoot;
|
m_qmakeGlobals->sysroot = systemRoot;
|
||||||
|
|
||||||
Utils::Environment::const_iterator eit = env.constBegin(), eend = env.constEnd();
|
Utils::Environment::const_iterator eit = env.constBegin(), eend = env.constEnd();
|
||||||
for (; eit != eend; ++eit)
|
for (; eit != eend; ++eit)
|
||||||
m_proFileOption->environment.insert(env.key(eit), env.value(eit));
|
m_qmakeGlobals->environment.insert(env.key(eit), env.value(eit));
|
||||||
|
|
||||||
m_proFileOption->setCommandLineArguments(qmakeArgs);
|
m_qmakeGlobals->setCommandLineArguments(qmakeArgs);
|
||||||
|
|
||||||
QtSupport::ProFileCacheManager::instance()->incRefCount();
|
QtSupport::ProFileCacheManager::instance()->incRefCount();
|
||||||
}
|
}
|
||||||
++m_proFileOptionRefCnt;
|
++m_qmakeGlobalsRefCnt;
|
||||||
|
|
||||||
QtSupport::ProFileReader *reader = new QtSupport::ProFileReader(m_proFileOption);
|
QtSupport::ProFileReader *reader = new QtSupport::ProFileReader(m_qmakeGlobals);
|
||||||
|
|
||||||
reader->setOutputDir(qt4ProFileNode->buildDir());
|
reader->setOutputDir(qt4ProFileNode->buildDir());
|
||||||
|
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProFileOption *Qt4Project::proFileOption()
|
QMakeGlobals *Qt4Project::qmakeGlobals()
|
||||||
{
|
{
|
||||||
return m_proFileOption;
|
return m_qmakeGlobals;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4Project::destroyProFileReader(QtSupport::ProFileReader *reader)
|
void Qt4Project::destroyProFileReader(QtSupport::ProFileReader *reader)
|
||||||
{
|
{
|
||||||
delete reader;
|
delete reader;
|
||||||
if (!--m_proFileOptionRefCnt) {
|
if (!--m_qmakeGlobalsRefCnt) {
|
||||||
QString dir = QFileInfo(m_fileInfo->fileName()).absolutePath();
|
QString dir = QFileInfo(m_fileInfo->fileName()).absolutePath();
|
||||||
if (!dir.endsWith(QLatin1Char('/')))
|
if (!dir.endsWith(QLatin1Char('/')))
|
||||||
dir += QLatin1Char('/');
|
dir += QLatin1Char('/');
|
||||||
QtSupport::ProFileCacheManager::instance()->discardFiles(dir);
|
QtSupport::ProFileCacheManager::instance()->discardFiles(dir);
|
||||||
QtSupport::ProFileCacheManager::instance()->decRefCount();
|
QtSupport::ProFileCacheManager::instance()->decRefCount();
|
||||||
|
|
||||||
delete m_proFileOption;
|
delete m_qmakeGlobals;
|
||||||
m_proFileOption = 0;
|
m_qmakeGlobals = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
struct ProFileOption;
|
struct QMakeGlobals;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QtSupport { class ProFileReader; }
|
namespace QtSupport { class ProFileReader; }
|
||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
/// \internal
|
/// \internal
|
||||||
QtSupport::ProFileReader *createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc = 0);
|
QtSupport::ProFileReader *createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc = 0);
|
||||||
/// \internal
|
/// \internal
|
||||||
ProFileOption *proFileOption();
|
QMakeGlobals *qmakeGlobals();
|
||||||
/// \internal
|
/// \internal
|
||||||
void destroyProFileReader(QtSupport::ProFileReader *reader);
|
void destroyProFileReader(QtSupport::ProFileReader *reader);
|
||||||
|
|
||||||
@@ -188,8 +188,8 @@ private:
|
|||||||
Internal::Qt4ProjectFiles *m_projectFiles;
|
Internal::Qt4ProjectFiles *m_projectFiles;
|
||||||
|
|
||||||
// cached data during project rescan
|
// cached data during project rescan
|
||||||
ProFileOption *m_proFileOption;
|
QMakeGlobals *m_qmakeGlobals;
|
||||||
int m_proFileOptionRefCnt;
|
int m_qmakeGlobalsRefCnt;
|
||||||
|
|
||||||
QTimer m_asyncUpdateTimer;
|
QTimer m_asyncUpdateTimer;
|
||||||
QFutureInterface<void> *m_asyncUpdateFutureInterface;
|
QFutureInterface<void> *m_asyncUpdateFutureInterface;
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ void BaseQtVersion::ensureMkSpecParsed() const
|
|||||||
if (mkspecPath().isEmpty())
|
if (mkspecPath().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ProFileOption option;
|
QMakeGlobals option;
|
||||||
option.properties = versionInfo();
|
option.properties = versionInfo();
|
||||||
ProMessageHandler msgHandler(true);
|
ProMessageHandler msgHandler(true);
|
||||||
ProFileCacheManager::instance()->incRefCount();
|
ProFileCacheManager::instance()->incRefCount();
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ void ProMessageHandler::fileMessage(const QString &)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ProFileReader::ProFileReader(ProFileOption *option)
|
ProFileReader::ProFileReader(QMakeGlobals *option)
|
||||||
: ProFileParser(ProFileCacheManager::instance()->cache(), this)
|
: ProFileParser(ProFileCacheManager::instance()->cache(), this)
|
||||||
, ProFileEvaluator(option, this, this)
|
, ProFileEvaluator(option, this, this)
|
||||||
, m_ignoreLevel(0)
|
, m_ignoreLevel(0)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class QTSUPPORT_EXPORT ProFileReader : public ProMessageHandler, public ProFileP
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProFileReader(ProFileOption *option);
|
ProFileReader(QMakeGlobals *option);
|
||||||
~ProFileReader();
|
~ProFileReader();
|
||||||
|
|
||||||
QList<ProFile*> includeFiles() const;
|
QList<ProFile*> includeFiles() const;
|
||||||
|
|||||||
@@ -76,12 +76,12 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileN
|
|||||||
return 0;
|
return 0;
|
||||||
Utils::FileName mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
|
Utils::FileName mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo);
|
||||||
|
|
||||||
ProFileOption option;
|
QMakeGlobals globals;
|
||||||
option.properties = versionInfo;
|
globals.properties = versionInfo;
|
||||||
ProMessageHandler msgHandler(true);
|
ProMessageHandler msgHandler(true);
|
||||||
ProFileCacheManager::instance()->incRefCount();
|
ProFileCacheManager::instance()->incRefCount();
|
||||||
ProFileParser parser(ProFileCacheManager::instance()->cache(), &msgHandler);
|
ProFileParser parser(ProFileCacheManager::instance()->cache(), &msgHandler);
|
||||||
ProFileEvaluator evaluator(&option, &parser, &msgHandler);
|
ProFileEvaluator evaluator(&globals, &parser, &msgHandler);
|
||||||
if (ProFile *pro = parser.parsedProFile(mkspec.toString() + QLatin1String("/qmake.conf"))) {
|
if (ProFile *pro = parser.parsedProFile(mkspec.toString() + QLatin1String("/qmake.conf"))) {
|
||||||
evaluator.setCumulative(false);
|
evaluator.setCumulative(false);
|
||||||
evaluator.accept(pro, ProFileEvaluator::LoadProOnly);
|
evaluator.accept(pro, ProFileEvaluator::LoadProOnly);
|
||||||
|
|||||||
@@ -80,11 +80,11 @@ using namespace ProStringConstants;
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// ProFileOption
|
// QMakeGlobal
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ProFileOption::ProFileOption()
|
QMakeGlobals::QMakeGlobals()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
dirlist_sep = QLatin1Char(';');
|
dirlist_sep = QLatin1Char(';');
|
||||||
@@ -103,11 +103,11 @@ ProFileOption::ProFileOption()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ProFileOption::~ProFileOption()
|
QMakeGlobals::~QMakeGlobals()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProFileOption::setCommandLineArguments(const QStringList &args)
|
void QMakeGlobals::setCommandLineArguments(const QStringList &args)
|
||||||
{
|
{
|
||||||
QStringList _precmds, _preconfigs, _postcmds, _postconfigs;
|
QStringList _precmds, _preconfigs, _postcmds, _postconfigs;
|
||||||
bool after = false;
|
bool after = false;
|
||||||
@@ -154,7 +154,7 @@ void ProFileOption::setCommandLineArguments(const QStringList &args)
|
|||||||
applyHostMode();
|
applyHostMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProFileOption::applyHostMode()
|
void QMakeGlobals::applyHostMode()
|
||||||
{
|
{
|
||||||
if (host_mode == HOST_WIN_MODE) {
|
if (host_mode == HOST_WIN_MODE) {
|
||||||
dir_sep = fL1S("\\");
|
dir_sep = fL1S("\\");
|
||||||
@@ -163,7 +163,7 @@ void ProFileOption::applyHostMode()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ProFileOption::getEnv(const QString &var) const
|
QString QMakeGlobals::getEnv(const QString &var) const
|
||||||
{
|
{
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#ifndef QT_BOOTSTRAPPED
|
||||||
if (!environment.isEmpty())
|
if (!environment.isEmpty())
|
||||||
@@ -173,7 +173,7 @@ QString ProFileOption::getEnv(const QString &var) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PROEVALUATOR_INIT_PROPS
|
#ifdef PROEVALUATOR_INIT_PROPS
|
||||||
bool ProFileOption::initProperties(const QString &qmake)
|
bool QMakeGlobals::initProperties(const QString &qmake)
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#ifndef QT_BOOTSTRAPPED
|
||||||
@@ -215,7 +215,7 @@ class ProFileEvaluator::Private
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void initStatics();
|
static void initStatics();
|
||||||
Private(ProFileOption *option, ProFileParser *parser,
|
Private(QMakeGlobals *option, ProFileParser *parser,
|
||||||
ProFileEvaluatorHandler *handler);
|
ProFileEvaluatorHandler *handler);
|
||||||
~Private();
|
~Private();
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ public:
|
|||||||
const ProString &function);
|
const ProString &function);
|
||||||
|
|
||||||
bool modesForGenerator(const QString &gen,
|
bool modesForGenerator(const QString &gen,
|
||||||
ProFileOption::HOST_MODE *host_mode, ProFileOption::TARG_MODE *target_mode) const;
|
QMakeGlobals::HOST_MODE *host_mode, QMakeGlobals::TARG_MODE *target_mode) const;
|
||||||
void validateModes() const;
|
void validateModes() const;
|
||||||
QStringList qmakeMkspecPaths() const;
|
QStringList qmakeMkspecPaths() const;
|
||||||
QStringList qmakeFeaturePaths() const;
|
QStringList qmakeFeaturePaths() const;
|
||||||
@@ -337,7 +337,7 @@ public:
|
|||||||
QStack<QHash<ProString, ProStringList> > m_valuemapStack; // VariableName must be us-ascii, the content however can be non-us-ascii.
|
QStack<QHash<ProString, ProStringList> > m_valuemapStack; // VariableName must be us-ascii, the content however can be non-us-ascii.
|
||||||
QString m_tmp1, m_tmp2, m_tmp3, m_tmp[2]; // Temporaries for efficient toQString
|
QString m_tmp1, m_tmp2, m_tmp3, m_tmp[2]; // Temporaries for efficient toQString
|
||||||
|
|
||||||
ProFileOption *m_option;
|
QMakeGlobals *m_option;
|
||||||
ProFileParser *m_parser;
|
ProFileParser *m_parser;
|
||||||
ProFileEvaluatorHandler *m_handler;
|
ProFileEvaluatorHandler *m_handler;
|
||||||
|
|
||||||
@@ -537,7 +537,7 @@ const ProString &ProFileEvaluator::Private::map(const ProString &var)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ProFileEvaluator::Private::Private(ProFileOption *option,
|
ProFileEvaluator::Private::Private(QMakeGlobals *option,
|
||||||
ProFileParser *parser, ProFileEvaluatorHandler *handler)
|
ProFileParser *parser, ProFileEvaluatorHandler *handler)
|
||||||
: m_option(option), m_parser(parser), m_handler(handler)
|
: m_option(option), m_parser(parser), m_handler(handler)
|
||||||
{
|
{
|
||||||
@@ -1464,19 +1464,19 @@ QStringList ProFileEvaluator::Private::qmakeFeaturePaths() const
|
|||||||
|
|
||||||
validateModes();
|
validateModes();
|
||||||
switch (m_option->target_mode) {
|
switch (m_option->target_mode) {
|
||||||
case ProFileOption::TARG_MACX_MODE:
|
case QMakeGlobals::TARG_MACX_MODE:
|
||||||
concat << QLatin1String("/features/mac");
|
concat << QLatin1String("/features/mac");
|
||||||
concat << QLatin1String("/features/macx");
|
concat << QLatin1String("/features/macx");
|
||||||
concat << QLatin1String("/features/unix");
|
concat << QLatin1String("/features/unix");
|
||||||
break;
|
break;
|
||||||
default: // Can't happen, just make the compiler shut up
|
default: // Can't happen, just make the compiler shut up
|
||||||
case ProFileOption::TARG_UNIX_MODE:
|
case QMakeGlobals::TARG_UNIX_MODE:
|
||||||
concat << QLatin1String("/features/unix");
|
concat << QLatin1String("/features/unix");
|
||||||
break;
|
break;
|
||||||
case ProFileOption::TARG_WIN_MODE:
|
case QMakeGlobals::TARG_WIN_MODE:
|
||||||
concat << QLatin1String("/features/win32");
|
concat << QLatin1String("/features/win32");
|
||||||
break;
|
break;
|
||||||
case ProFileOption::TARG_SYMBIAN_MODE:
|
case QMakeGlobals::TARG_SYMBIAN_MODE:
|
||||||
concat << QLatin1String("/features/symbian");
|
concat << QLatin1String("/features/symbian");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1882,41 +1882,41 @@ ProStringList ProFileEvaluator::Private::expandVariableReferences(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ProFileEvaluator::Private::modesForGenerator(const QString &gen,
|
bool ProFileEvaluator::Private::modesForGenerator(const QString &gen,
|
||||||
ProFileOption::HOST_MODE *host_mode, ProFileOption::TARG_MODE *target_mode) const
|
QMakeGlobals::HOST_MODE *host_mode, QMakeGlobals::TARG_MODE *target_mode) const
|
||||||
{
|
{
|
||||||
if (gen == fL1S("UNIX")) {
|
if (gen == fL1S("UNIX")) {
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
*host_mode = ProFileOption::HOST_MACX_MODE;
|
*host_mode = QMakeGlobals::HOST_MACX_MODE;
|
||||||
*target_mode = ProFileOption::TARG_MACX_MODE;
|
*target_mode = QMakeGlobals::TARG_MACX_MODE;
|
||||||
#else
|
#else
|
||||||
*host_mode = ProFileOption::HOST_UNIX_MODE;
|
*host_mode = QMakeGlobals::HOST_UNIX_MODE;
|
||||||
*target_mode = ProFileOption::TARG_UNIX_MODE;
|
*target_mode = QMakeGlobals::TARG_UNIX_MODE;
|
||||||
#endif
|
#endif
|
||||||
} else if (gen == fL1S("MSVC.NET") || gen == fL1S("BMAKE") || gen == fL1S("MSBUILD")) {
|
} else if (gen == fL1S("MSVC.NET") || gen == fL1S("BMAKE") || gen == fL1S("MSBUILD")) {
|
||||||
*host_mode = ProFileOption::HOST_WIN_MODE;
|
*host_mode = QMakeGlobals::HOST_WIN_MODE;
|
||||||
*target_mode = ProFileOption::TARG_WIN_MODE;
|
*target_mode = QMakeGlobals::TARG_WIN_MODE;
|
||||||
} else if (gen == fL1S("MINGW")) {
|
} else if (gen == fL1S("MINGW")) {
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
*host_mode = ProFileOption::HOST_MACX_MODE;
|
*host_mode = QMakeGlobals::HOST_MACX_MODE;
|
||||||
#elif defined(Q_OS_UNIX)
|
#elif defined(Q_OS_UNIX)
|
||||||
*host_mode = ProFileOption::HOST_UNIX_MODE;
|
*host_mode = QMakeGlobals::HOST_UNIX_MODE;
|
||||||
#else
|
#else
|
||||||
*host_mode = ProFileOption::HOST_WIN_MODE;
|
*host_mode = QMakeGlobals::HOST_WIN_MODE;
|
||||||
#endif
|
#endif
|
||||||
*target_mode = ProFileOption::TARG_WIN_MODE;
|
*target_mode = QMakeGlobals::TARG_WIN_MODE;
|
||||||
} else if (gen == fL1S("PROJECTBUILDER") || gen == fL1S("XCODE")) {
|
} else if (gen == fL1S("PROJECTBUILDER") || gen == fL1S("XCODE")) {
|
||||||
*host_mode = ProFileOption::HOST_MACX_MODE;
|
*host_mode = QMakeGlobals::HOST_MACX_MODE;
|
||||||
*target_mode = ProFileOption::TARG_MACX_MODE;
|
*target_mode = QMakeGlobals::TARG_MACX_MODE;
|
||||||
} else if (gen == fL1S("SYMBIAN_ABLD") || gen == fL1S("SYMBIAN_SBSV2")
|
} else if (gen == fL1S("SYMBIAN_ABLD") || gen == fL1S("SYMBIAN_SBSV2")
|
||||||
|| gen == fL1S("SYMBIAN_UNIX") || gen == fL1S("SYMBIAN_MINGW")) {
|
|| gen == fL1S("SYMBIAN_UNIX") || gen == fL1S("SYMBIAN_MINGW")) {
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
*host_mode = ProFileOption::HOST_MACX_MODE;
|
*host_mode = QMakeGlobals::HOST_MACX_MODE;
|
||||||
#elif defined(Q_OS_UNIX)
|
#elif defined(Q_OS_UNIX)
|
||||||
*host_mode = ProFileOption::HOST_UNIX_MODE;
|
*host_mode = QMakeGlobals::HOST_UNIX_MODE;
|
||||||
#else
|
#else
|
||||||
*host_mode = ProFileOption::HOST_WIN_MODE;
|
*host_mode = QMakeGlobals::HOST_WIN_MODE;
|
||||||
#endif
|
#endif
|
||||||
*target_mode = ProFileOption::TARG_SYMBIAN_MODE;
|
*target_mode = QMakeGlobals::TARG_SYMBIAN_MODE;
|
||||||
} else {
|
} else {
|
||||||
evalError(fL1S("Unknown generator specified: %1").arg(gen));
|
evalError(fL1S("Unknown generator specified: %1").arg(gen));
|
||||||
return false;
|
return false;
|
||||||
@@ -1926,33 +1926,33 @@ bool ProFileEvaluator::Private::modesForGenerator(const QString &gen,
|
|||||||
|
|
||||||
void ProFileEvaluator::Private::validateModes() const
|
void ProFileEvaluator::Private::validateModes() const
|
||||||
{
|
{
|
||||||
if (m_option->host_mode == ProFileOption::HOST_UNKNOWN_MODE
|
if (m_option->host_mode == QMakeGlobals::HOST_UNKNOWN_MODE
|
||||||
|| m_option->target_mode == ProFileOption::TARG_UNKNOWN_MODE) {
|
|| m_option->target_mode == QMakeGlobals::TARG_UNKNOWN_MODE) {
|
||||||
const QHash<ProString, ProStringList> &vals =
|
const QHash<ProString, ProStringList> &vals =
|
||||||
m_option->base_valuemap.isEmpty() ? m_valuemapStack[0] : m_option->base_valuemap;
|
m_option->base_valuemap.isEmpty() ? m_valuemapStack[0] : m_option->base_valuemap;
|
||||||
ProFileOption::HOST_MODE host_mode;
|
QMakeGlobals::HOST_MODE host_mode;
|
||||||
ProFileOption::TARG_MODE target_mode;
|
QMakeGlobals::TARG_MODE target_mode;
|
||||||
const ProStringList &gen = vals.value(ProString("MAKEFILE_GENERATOR"));
|
const ProStringList &gen = vals.value(ProString("MAKEFILE_GENERATOR"));
|
||||||
if (gen.isEmpty()) {
|
if (gen.isEmpty()) {
|
||||||
evalError(fL1S("Using OS scope before setting MAKEFILE_GENERATOR"));
|
evalError(fL1S("Using OS scope before setting MAKEFILE_GENERATOR"));
|
||||||
} else if (modesForGenerator(gen.at(0).toQString(), &host_mode, &target_mode)) {
|
} else if (modesForGenerator(gen.at(0).toQString(), &host_mode, &target_mode)) {
|
||||||
if (m_option->host_mode == ProFileOption::HOST_UNKNOWN_MODE) {
|
if (m_option->host_mode == QMakeGlobals::HOST_UNKNOWN_MODE) {
|
||||||
m_option->host_mode = host_mode;
|
m_option->host_mode = host_mode;
|
||||||
m_option->applyHostMode();
|
m_option->applyHostMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_option->target_mode == ProFileOption::TARG_UNKNOWN_MODE) {
|
if (m_option->target_mode == QMakeGlobals::TARG_UNKNOWN_MODE) {
|
||||||
const ProStringList &tgt = vals.value(ProString("TARGET_PLATFORM"));
|
const ProStringList &tgt = vals.value(ProString("TARGET_PLATFORM"));
|
||||||
if (!tgt.isEmpty()) {
|
if (!tgt.isEmpty()) {
|
||||||
const QString &os = tgt.at(0).toQString();
|
const QString &os = tgt.at(0).toQString();
|
||||||
if (os == statics.strunix)
|
if (os == statics.strunix)
|
||||||
m_option->target_mode = ProFileOption::TARG_UNIX_MODE;
|
m_option->target_mode = QMakeGlobals::TARG_UNIX_MODE;
|
||||||
else if (os == statics.strmacx)
|
else if (os == statics.strmacx)
|
||||||
m_option->target_mode = ProFileOption::TARG_MACX_MODE;
|
m_option->target_mode = QMakeGlobals::TARG_MACX_MODE;
|
||||||
else if (os == statics.strsymbian)
|
else if (os == statics.strsymbian)
|
||||||
m_option->target_mode = ProFileOption::TARG_SYMBIAN_MODE;
|
m_option->target_mode = QMakeGlobals::TARG_SYMBIAN_MODE;
|
||||||
else if (os == statics.strwin32)
|
else if (os == statics.strwin32)
|
||||||
m_option->target_mode = ProFileOption::TARG_WIN_MODE;
|
m_option->target_mode = QMakeGlobals::TARG_WIN_MODE;
|
||||||
else
|
else
|
||||||
evalError(fL1S("Unknown target platform specified: %1").arg(os));
|
evalError(fL1S("Unknown target platform specified: %1").arg(os));
|
||||||
} else {
|
} else {
|
||||||
@@ -1973,18 +1973,18 @@ bool ProFileEvaluator::Private::isActiveConfig(const QString &config, bool regex
|
|||||||
|
|
||||||
if (config == statics.strunix) {
|
if (config == statics.strunix) {
|
||||||
validateModes();
|
validateModes();
|
||||||
return m_option->target_mode == ProFileOption::TARG_UNIX_MODE
|
return m_option->target_mode == QMakeGlobals::TARG_UNIX_MODE
|
||||||
|| m_option->target_mode == ProFileOption::TARG_MACX_MODE
|
|| m_option->target_mode == QMakeGlobals::TARG_MACX_MODE
|
||||||
|| m_option->target_mode == ProFileOption::TARG_SYMBIAN_MODE;
|
|| m_option->target_mode == QMakeGlobals::TARG_SYMBIAN_MODE;
|
||||||
} else if (config == statics.strmacx || config == statics.strmac) {
|
} else if (config == statics.strmacx || config == statics.strmac) {
|
||||||
validateModes();
|
validateModes();
|
||||||
return m_option->target_mode == ProFileOption::TARG_MACX_MODE;
|
return m_option->target_mode == QMakeGlobals::TARG_MACX_MODE;
|
||||||
} else if (config == statics.strsymbian) {
|
} else if (config == statics.strsymbian) {
|
||||||
validateModes();
|
validateModes();
|
||||||
return m_option->target_mode == ProFileOption::TARG_SYMBIAN_MODE;
|
return m_option->target_mode == QMakeGlobals::TARG_SYMBIAN_MODE;
|
||||||
} else if (config == statics.strwin32) {
|
} else if (config == statics.strwin32) {
|
||||||
validateModes();
|
validateModes();
|
||||||
return m_option->target_mode == ProFileOption::TARG_WIN_MODE;
|
return m_option->target_mode == QMakeGlobals::TARG_WIN_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (regex && (config.contains(QLatin1Char('*')) || config.contains(QLatin1Char('?')))) {
|
if (regex && (config.contains(QLatin1Char('*')) || config.contains(QLatin1Char('?')))) {
|
||||||
@@ -3398,7 +3398,7 @@ void ProFileEvaluator::initialize()
|
|||||||
Private::initStatics();
|
Private::initStatics();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProFileEvaluator::ProFileEvaluator(ProFileOption *option, ProFileParser *parser,
|
ProFileEvaluator::ProFileEvaluator(QMakeGlobals *option, ProFileParser *parser,
|
||||||
ProFileEvaluatorHandler *handler)
|
ProFileEvaluatorHandler *handler)
|
||||||
: d(new Private(option, parser, handler))
|
: d(new Private(option, parser, handler))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
struct ProFileOption;
|
struct QMakeGlobals;
|
||||||
class ProFileParser;
|
class ProFileParser;
|
||||||
|
|
||||||
class QMAKE_EXPORT ProFileEvaluatorHandler
|
class QMAKE_EXPORT ProFileEvaluatorHandler
|
||||||
@@ -111,7 +111,7 @@ public:
|
|||||||
// Call this from a concurrency-free context
|
// Call this from a concurrency-free context
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
ProFileEvaluator(ProFileOption *option, ProFileParser *parser, ProFileEvaluatorHandler *handler);
|
ProFileEvaluator(QMakeGlobals *option, ProFileParser *parser, ProFileEvaluatorHandler *handler);
|
||||||
~ProFileEvaluator();
|
~ProFileEvaluator();
|
||||||
|
|
||||||
ProFileEvaluator::TemplateType templateType() const;
|
ProFileEvaluator::TemplateType templateType() const;
|
||||||
@@ -142,16 +142,15 @@ public:
|
|||||||
private:
|
private:
|
||||||
Private *d;
|
Private *d;
|
||||||
|
|
||||||
friend struct ProFileOption;
|
friend struct QMakeGlobals;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(ProFileEvaluator::LoadFlags)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(ProFileEvaluator::LoadFlags)
|
||||||
|
|
||||||
// This struct is from qmake, but we are not using everything.
|
// This struct is from qmake, but we are not using everything.
|
||||||
struct QMAKE_EXPORT ProFileOption
|
struct QMAKE_EXPORT QMakeGlobals {
|
||||||
{
|
QMakeGlobals();
|
||||||
ProFileOption();
|
~QMakeGlobals();
|
||||||
~ProFileOption();
|
|
||||||
|
|
||||||
//simply global convenience
|
//simply global convenience
|
||||||
//QString libtool_ext;
|
//QString libtool_ext;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ static QString value(ProFileEvaluator &reader, const QString &variable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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, ProFileOption *option, ProFileParser *parser, int level)
|
bool cumulative, QMakeGlobals *option, ProFileParser *parser, int level)
|
||||||
{
|
{
|
||||||
static QSet<QString> visited;
|
static QSet<QString> visited;
|
||||||
if (visited.contains(fileName))
|
if (visited.contains(fileName))
|
||||||
@@ -159,7 +159,7 @@ int main(int argc, char **argv)
|
|||||||
if (args.count() < 2)
|
if (args.count() < 2)
|
||||||
qFatal("need at least two arguments: [-v] <cumulative?> <filenme> [<out_pwd> [<qmake options>]]");
|
qFatal("need at least two arguments: [-v] <cumulative?> <filenme> [<out_pwd> [<qmake options>]]");
|
||||||
|
|
||||||
ProFileOption option;
|
QMakeGlobals option;
|
||||||
option.initProperties(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake"));
|
option.initProperties(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake"));
|
||||||
if (args.count() >= 4)
|
if (args.count() >= 4)
|
||||||
option.setCommandLineArguments(args.mid(3));
|
option.setCommandLineArguments(args.mid(3));
|
||||||
|
|||||||
Reference in New Issue
Block a user