Commit 37b2f88e authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

ProFileOption => QMakeGlobals



more accurate class name

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