aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/header_paths.h
blob: af4a768e8afffd36b37f3e3ac1013bc19bfbf3fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef HEADER_PATHS_H
#define HEADER_PATHS_H

#include <QtCore/QByteArray>
#include <QtCore/QList>

enum class HeaderType
{
    Standard,
    System,         // -isystem
    Framework,      // macOS framework path
    FrameworkSystem // macOS framework system path
};

class HeaderPath {
public:
    QByteArray path;
    HeaderType type;

    static QByteArray includeOption(const HeaderPath &p)
    {
        QByteArray option;
        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;
    }
};

using HeaderPaths = QList<HeaderPath>;

#endif // HEADER_PATHS_H