blob: f3410be441e6b0355395430c5f4d2d30369d8e14 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "projectexplorer_export.h"
#include "toolchain.h"
#include <QList>
#include <QObject>
#include <QSet>
#include <QString>
#include <functional>
namespace Utils { class FilePath; }
namespace ProjectExplorer {
class ProjectExplorerPlugin;
class Abi;
class ToolchainDetectionSettings
{
public:
bool detectX64AsX32 = false;
};
// --------------------------------------------------------------------------
// ToolChainManager
// --------------------------------------------------------------------------
class PROJECTEXPLORER_EXPORT ToolChainManager : public QObject
{
Q_OBJECT
public:
static ToolChainManager *instance();
~ToolChainManager() override;
static const Toolchains &toolchains();
static Toolchains toolchains(const ToolChain::Predicate &predicate);
static ToolChain *toolChain(const ToolChain::Predicate &predicate);
static QList<ToolChain *> findToolChains(const Abi &abi);
static ToolChain *findToolChain(const QByteArray &id);
static bool isLoaded();
static bool registerToolChain(ToolChain *tc);
static void deregisterToolChain(ToolChain *tc);
static QList<Utils::Id> allLanguages();
static bool registerLanguage(const Utils::Id &language, const QString &displayName);
static QString displayNameOfLanguageId(const Utils::Id &id);
static bool isLanguageSupported(const Utils::Id &id);
static void aboutToShutdown();
static ToolchainDetectionSettings detectionSettings();
static void setDetectionSettings(const ToolchainDetectionSettings &settings);
static void resetBadToolchains();
static bool isBadToolchain(const Utils::FilePath &toolchain);
static void addBadToolchain(const Utils::FilePath &toolchain);
void saveToolChains();
signals:
void toolChainAdded(ProjectExplorer::ToolChain *);
// Tool chain is still valid when this call happens!
void toolChainRemoved(ProjectExplorer::ToolChain *);
// Tool chain was updated.
void toolChainUpdated(ProjectExplorer::ToolChain *);
// Something changed.
void toolChainsChanged();
//
void toolChainsLoaded();
private:
explicit ToolChainManager(QObject *parent = nullptr);
// Make sure the this is only called after all toolchain factories are registered!
static void restoreToolChains();
static void notifyAboutUpdate(ToolChain *);
friend class ProjectExplorerPlugin; // for constructor
friend class ToolChain;
};
} // namespace ProjectExplorer
|