Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmakeglobals.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QMAKEGLOBALS_H
5#define QMAKEGLOBALS_H
6
7#include "qmake_global.h"
8#include "proitems.h"
9
10#ifdef QT_BUILD_QMAKE
11# include <property.h>
12#endif
13
14#include <qhash.h>
15#include <qstringlist.h>
16#if QT_CONFIG(process)
17# include <qprocess.h>
18#endif
19#ifdef PROEVALUATOR_THREAD_SAFE
20# include <qmutex.h>
21# include <qwaitcondition.h>
22#endif
23
25
26class QMakeEvaluator;
27
29
31{
32public:
33 QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild);
34
35 QString root;
36 QString stash;
38};
39
40size_t qHash(const QMakeBaseKey &key);
41bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two);
42
44{
45public:
47 ~QMakeBaseEnv();
48
49#ifdef PROEVALUATOR_THREAD_SAFE
52 bool inProgress;
53 // The coupling of this flag to thread safety exists because for other
54 // use cases failure is immediately fatal anyway.
55 bool isOk;
56#endif
58};
59
71
73{
74public:
76 ~QMakeGlobals();
77
79 QString dir_sep;
80 QString dirlist_sep;
81 QString cachefile;
82#ifdef PROEVALUATOR_SETENV
84#endif
87
88 QString qtconf;
91 QString extra_cmds[4];
92
93#ifdef PROEVALUATOR_DEBUG
94 int debugLevel;
95#endif
96
99 QStringList &args, int *pos);
101 void setCommandLineArguments(const QString &pwd, const QStringList &args);
102 void useEnvironment();
103 void setDirectories(const QString &input_dir, const QString &output_dir);
104#ifdef QT_BUILD_QMAKE
106 void reloadProperties() { property->reload(); }
107 ProString propertyValue(const ProKey &name) const { return property->value(name); }
108#else
109 static void parseProperties(const QByteArray &data, QHash<ProKey, ProString> &props);
110# ifdef PROEVALUATOR_INIT_PROPS
111 bool initProperties();
112# else
113 void setProperties(const QHash<ProKey, ProString> &props) { properties = props; }
114# endif
115 ProString propertyValue(const ProKey &name) const { return properties.value(name); }
116#endif
117
118 QString expandEnvVars(const QString &str) const;
119 QString shadowedPath(const QString &fileName) const;
120 QStringList splitPathList(const QString &value) const;
121
122private:
123 QString getEnv(const QString &) const;
124 QStringList getPathListEnv(const QString &var) const;
125
126 QString cleanSpec(QMakeCmdLineParserState &state, const QString &spec);
127
128 QString source_root, build_root;
129
130#ifdef QT_BUILD_QMAKE
132#else
133 QHash<ProKey, ProString> properties;
134#endif
135
136#ifdef PROEVALUATOR_THREAD_SAFE
138#endif
139 QHash<QMakeBaseKey, QMakeBaseEnv *> baseEnvs;
140
141 friend class QMakeEvaluator;
142};
143
144QT_END_NAMESPACE
145
146#endif // QMAKEGLOBALS_H
int main(int argc, char *argv[])
[2]
Definition buffer.cpp:77
void message(int type, const QString &msg, const QString &fileName, int lineNo) override
Definition main.cpp:100
void fileMessage(int type, const QString &msg) override
Definition main.cpp:106
void doneWithEval(ProFile *) override
Definition main.cpp:115
void aboutToEval(ProFile *, ProFile *, EvalFileType) override
Definition main.cpp:114
bool verbose
Definition main.cpp:117
ProFileEvaluator::TemplateType templateType() const
ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeVfs *vfs, QMakeHandler *handler)
void setExtraConfigs(const QStringList &extraConfigs)
void setExtraVars(const QHash< QString, QStringList > &extraVars)
QStringList values(const QString &variableName, const ProFile *pro) const
QString value(const QString &variableName) const
bool contains(const QString &variableName) const
QString resolvedMkSpec() const
static void initialize()
bool accept(ProFile *pro, QMakeEvaluator::LoadFlags flags=QMakeEvaluator::LoadAll)
QStringList absoluteFileValues(const QString &variable, const QString &baseDirectory, const QStringList &searchDirs, const ProFile *pro) const
void setOutputDir(const QString &dir)
QStringList absolutePathValues(const QString &variable, const QString &baseDirectory) const
QStringList values(const QString &variableName) const
QString propertyValue(const QString &val) const
bool loadNamedSpec(const QString &specDir, bool hostSpec)
\inmodule QtCore
Definition qhash.h:821
QMakeEvaluator * evaluator
QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild)
QString stash
QStringList configs[4]
QMakeCmdLineParserState(const QString &_pwd)
void useEnvironment()
QString user_template_prefix
QString cachefile
QStringList splitPathList(const QString &value) const
QString dir_sep
QString user_template
void setCommandLineArguments(const QString &pwd, const QStringList &args)
QString qtconf
QString qmakespec
void setProperties(const QHash< ProKey, ProString > &props)
void setDirectories(const QString &input_dir, const QString &output_dir)
QStringList qmake_args
QString dirlist_sep
QString expandEnvVars(const QString &str) const
QString xqmakespec
QString extra_cmds[4]
QStringList qmake_extra_args
QString qmake_abslocation
void commitCommandLineArguments(QMakeCmdLineParserState &state)
ArgumentReturn addCommandLineArguments(QMakeCmdLineParserState &state, QStringList &args, int *pos)
QString shadowedPath(const QString &fileName) const
static void parseProperties(const QByteArray &data, QHash< ProKey, ProString > &props)
ProString propertyValue(const ProKey &name) const
ReadResult readFile(int id, QString *contents, QString *errStr)
Definition qmakevfs.cpp:165
@ VfsCumulative
Definition qmakevfs.h:41
bool hasError() const
Definition qrcreader.h:17
Combined button and popup list for selecting options.
const QString & asString(const QString &s)
Definition qstring.h:1547
Definition qcompare.h:72
#define QMAKE_EXPORT
bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two)
QMakeEvalPhase
@ QMakeEvalBefore
@ QMakeEvalLate
@ QMakeEvalEarly
@ QMakeEvalAfter
size_t qHash(const QMakeBaseKey &key)
#define qPrintable(string)
Definition qstring.h:1552
static void printOut(const QString &out)
Definition main.cpp:29
static void printUsage()
Definition main.cpp:60
QStringList getExcludes(const ProFileEvaluator &visitor, const QString &projectDirPath)
Definition main.cpp:207
static QStringList getSources(const ProFileEvaluator &visitor, const QString &projectDir, QMakeVfs *vfs)
Definition main.cpp:151
static void excludeProjects(const ProFileEvaluator &visitor, QStringList *subProjects)
Definition main.cpp:218
void setValue(QJsonObject &obj, const char *key, T value)
Definition main.cpp:55
static void print(const QString &fileName, int lineNo, const QString &msg)
Definition main.cpp:88
static QJsonValue toJsonValue(const QString &s)
Definition main.cpp:44
static QJsonObject processProject(const QString &proFile, const QStringList &translationsVariables, ProFileGlobals *option, QMakeVfs *vfs, QMakeParser *parser, ProFileEvaluator &visitor)
Definition main.cpp:237
static EvalHandler evalHandler
Definition main.cpp:120
static QJsonValue toJsonValue(const QJsonValue &v)
Definition main.cpp:39
static QStringList getSources(const char *var, const char *vvar, const QStringList &baseVPaths, const QString &projectDir, const ProFileEvaluator &visitor)
Definition main.cpp:142
static QJsonArray processProjects(bool topLevel, const QStringList &proFiles, const QStringList &translationsVariables, const QHash< QString, QString > &outDirMap, ProFileGlobals *option, QMakeVfs *vfs, QMakeParser *parser, bool *fail)
Definition main.cpp:281
static QStringList getResources(const QString &resourceFile, QMakeVfs *vfs)
Definition main.cpp:122
static void printErr(const QString &out)
Definition main.cpp:34