aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/header_paths.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-21 17:04:40 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-22 20:20:44 +0000
commitcf4dc77a973fa488594a818381cc9f0941a4f940 (patch)
treef12f030f58291adb43d17837784194add1fb1890 /sources/shiboken2/ApiExtractor/header_paths.h
parent5cf419c973ac367ab36e47abf4bde953ae533706 (diff)
shiboken: Add command line options for system include paths
Refactor class HeaderPath to contain an enumeration for the type instead of the boolean framework flag and add handling. Task-number: PYSIDE-693 Change-Id: I60a62b831ddd5ce7519a066135854ff723db2fc6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/header_paths.h')
-rw-r--r--sources/shiboken2/ApiExtractor/header_paths.h38
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;
}
};