| 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 PROFILEEVALUATOR_H |
| 5 | #define PROFILEEVALUATOR_H |
| 6 | |
| 7 | #include "qmake_global.h" |
| 8 | #include "qmakeglobals.h" |
| 9 | #include "qmakeevaluator.h" |
| 10 | #include "proitems.h" |
| 11 | |
| 12 | #include <QHash> |
| 13 | #include <QStringList> |
| 14 | |
| 15 | QT_BEGIN_NAMESPACE |
| 16 | |
| 17 | class QMakeVfs; |
| 18 | class QMakeParser; |
| 19 | class QMakeEvaluator; |
| 20 | class QMakeHandler; |
| 21 | |
| 22 | class QMAKE_EXPORT ProFileGlobals : public QMakeGlobals |
| 23 | { |
| 24 | public: |
| 25 | QString sysroot; |
| 26 | }; |
| 27 | |
| 28 | class QMAKE_EXPORT ProFileEvaluator |
| 29 | { |
| 30 | public: |
| 31 | enum TemplateType { |
| 32 | TT_Unknown = 0, |
| 33 | TT_Application, |
| 34 | TT_Library, |
| 35 | TT_Script, |
| 36 | TT_Aux, |
| 37 | TT_Subdirs |
| 38 | }; |
| 39 | |
| 40 | // Call this from a concurrency-free context |
| 41 | static void initialize(); |
| 42 | |
| 43 | ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeVfs *vfs, |
| 44 | QMakeHandler *handler); |
| 45 | ~ProFileEvaluator(); |
| 46 | |
| 47 | ProFileEvaluator::TemplateType templateType() const; |
| 48 | #ifdef PROEVALUATOR_CUMULATIVE |
| 49 | void setCumulative(bool on); // Default is false |
| 50 | #endif |
| 51 | void (const QHash<QString, QStringList> &); |
| 52 | void (const QStringList &); |
| 53 | void setOutputDir(const QString &dir); // Default is empty |
| 54 | |
| 55 | bool loadNamedSpec(const QString &specDir, bool hostSpec); |
| 56 | |
| 57 | bool accept(ProFile *pro, QMakeEvaluator::LoadFlags flags = QMakeEvaluator::LoadAll); |
| 58 | |
| 59 | bool contains(const QString &variableName) const; |
| 60 | QString value(const QString &variableName) const; |
| 61 | QStringList values(const QString &variableName) const; |
| 62 | QStringList values(const QString &variableName, const ProFile *pro) const; |
| 63 | QStringList absolutePathValues(const QString &variable, const QString &baseDirectory) const; |
| 64 | QStringList absoluteFileValues( |
| 65 | const QString &variable, const QString &baseDirectory, const QStringList &searchDirs, |
| 66 | const ProFile *pro) const; |
| 67 | QString propertyValue(const QString &val) const; |
| 68 | |
| 69 | QString resolvedMkSpec() const; |
| 70 | |
| 71 | private: |
| 72 | QString sysrootify(const QString &path, const QString &baseDir) const; |
| 73 | |
| 74 | QMakeEvaluator *d; |
| 75 | }; |
| 76 | |
| 77 | QT_END_NAMESPACE |
| 78 | |
| 79 | #endif // PROFILEEVALUATOR_H |
| 80 | |