2014-09-25 11:11:58 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** This file is part of Qt Creator.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
2014-09-25 11:11:58 +02:00
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-14 10:59:10 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2018-05-07 15:40:14 +02:00
|
|
|
#include <coreplugin/id.h>
|
2019-09-25 15:46:15 +02:00
|
|
|
#include <cpptools/clangdiagnosticconfig.h>
|
2018-05-07 15:40:14 +02:00
|
|
|
|
2019-09-25 15:46:15 +02:00
|
|
|
#include <QObject>
|
2014-09-25 11:11:58 +02:00
|
|
|
#include <QString>
|
|
|
|
|
|
2018-03-14 12:58:12 +01:00
|
|
|
namespace ClangTools {
|
2014-09-25 11:11:58 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2019-11-27 11:02:48 +01:00
|
|
|
const char diagnosticConfigIdKey[] = "DiagnosticConfig";
|
2019-09-13 10:49:14 +02:00
|
|
|
|
|
|
|
|
class RunSettings
|
2014-09-25 11:11:58 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2019-09-13 10:49:14 +02:00
|
|
|
RunSettings();
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
void fromMap(const QVariantMap &map, const QString &prefix = QString());
|
|
|
|
|
void toMap(QVariantMap &map, const QString &prefix = QString()) const;
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
Core::Id diagnosticConfigId() const { return m_diagnosticConfigId; }
|
|
|
|
|
void setDiagnosticConfigId(const Core::Id &id) { m_diagnosticConfigId = id; }
|
2019-09-25 15:46:15 +02:00
|
|
|
void resetDiagnosticConfigId();
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
bool buildBeforeAnalysis() const { return m_buildBeforeAnalysis; }
|
|
|
|
|
void setBuildBeforeAnalysis(bool yesno) { m_buildBeforeAnalysis = yesno; }
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
int parallelJobs() const { return m_parallelJobs; }
|
|
|
|
|
void setParallelJobs(int jobs) { m_parallelJobs = jobs; }
|
|
|
|
|
|
|
|
|
|
private:
|
2019-09-25 15:46:15 +02:00
|
|
|
Core::Id m_diagnosticConfigId;
|
2019-09-13 10:49:14 +02:00
|
|
|
int m_parallelJobs = -1;
|
|
|
|
|
bool m_buildBeforeAnalysis = true;
|
|
|
|
|
};
|
2018-05-02 16:13:01 +02:00
|
|
|
|
2019-09-25 15:46:15 +02:00
|
|
|
class ClangToolsSettings : public QObject
|
2019-09-13 10:49:14 +02:00
|
|
|
{
|
2019-09-25 15:46:15 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
public:
|
|
|
|
|
static ClangToolsSettings *instance();
|
|
|
|
|
void writeSettings();
|
2018-05-07 15:40:14 +02:00
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
QString clangTidyExecutable() const { return m_clangTidyExecutable; }
|
|
|
|
|
void setClangTidyExecutable(const QString &path) { m_clangTidyExecutable = path; }
|
2019-08-28 08:56:22 +02:00
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
QString clazyStandaloneExecutable() const { return m_clazyStandaloneExecutable; }
|
|
|
|
|
void setClazyStandaloneExecutable(const QString &path) { m_clazyStandaloneExecutable = path; }
|
2019-08-28 08:56:22 +02:00
|
|
|
|
2019-09-25 15:46:15 +02:00
|
|
|
CppTools::ClangDiagnosticConfigs diagnosticConfigs() const { return m_diagnosticConfigs; }
|
|
|
|
|
void setDiagnosticConfigs(const CppTools::ClangDiagnosticConfigs &configs)
|
|
|
|
|
{ m_diagnosticConfigs = configs; }
|
|
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
RunSettings runSettings() const { return m_runSettings; }
|
|
|
|
|
void setRunSettings(const RunSettings &settings) { m_runSettings = settings; }
|
2018-05-02 16:13:01 +02:00
|
|
|
|
2019-09-25 15:46:15 +02:00
|
|
|
signals:
|
|
|
|
|
void changed();
|
|
|
|
|
|
2014-09-25 11:11:58 +02:00
|
|
|
private:
|
2018-01-17 15:08:30 +01:00
|
|
|
ClangToolsSettings();
|
2014-09-25 11:11:58 +02:00
|
|
|
void readSettings();
|
|
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
// Executables
|
2019-08-28 08:56:22 +02:00
|
|
|
QString m_clangTidyExecutable;
|
|
|
|
|
QString m_clazyStandaloneExecutable;
|
2019-09-13 10:49:14 +02:00
|
|
|
|
2019-09-25 15:46:15 +02:00
|
|
|
// Diagnostic Configs
|
|
|
|
|
CppTools::ClangDiagnosticConfigs m_diagnosticConfigs;
|
|
|
|
|
|
2019-09-13 10:49:14 +02:00
|
|
|
// Run settings
|
|
|
|
|
RunSettings m_runSettings;
|
2014-09-25 11:11:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2018-03-14 12:58:12 +01:00
|
|
|
} // namespace ClangTools
|