diff options
Diffstat (limited to 'sources/shiboken2/ApiExtractor/header_paths.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/header_paths.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/sources/shiboken2/ApiExtractor/header_paths.h b/sources/shiboken2/ApiExtractor/header_paths.h index 4681f14de..01d830921 100644 --- a/sources/shiboken2/ApiExtractor/header_paths.h +++ b/sources/shiboken2/ApiExtractor/header_paths.h @@ -33,30 +33,36 @@ #include <QList> #include <QString> +enum class HeaderType +{ + Standard, + System, // -isystem + Framework, // macOS framework path + FrameworkSystem // macOS framework system path +}; + class HeaderPath { public: - explicit HeaderPath(const QByteArray &p = QByteArray()) : path(p), m_isFramework(false) {} - explicit HeaderPath(const QString &s = QString(), bool isFramework = false) : - path(s.toLatin1()), m_isFramework(isFramework) {} - QByteArray path; - bool m_isFramework; // macOS framework path + HeaderType type; - static QByteArray includeOption(const HeaderPath &p, bool systemInclude = false) + static QByteArray includeOption(const HeaderPath &p) { QByteArray option; - - if (p.m_isFramework) { - if (systemInclude) - option = QByteArrayLiteral("-iframework"); - else - option = QByteArrayLiteral("-F"); - } else if (systemInclude) { - option = QByteArrayLiteral("-isystem"); - } else { + switch (p.type) { + case HeaderType::Standard: option = QByteArrayLiteral("-I"); + break; + case HeaderType::System: + option = QByteArrayLiteral("-isystem"); + break; + case HeaderType::Framework: + option = QByteArrayLiteral("-F"); + break; + case HeaderType::FrameworkSystem: + option = QByteArrayLiteral("-iframework"); + break; } - return option + p.path; } }; |