forked from qt-creator/qt-creator
ClangTools: Allow selecting diagnostic config for project
When starting the Clazy/Tidy tool, allow to select the diagnostic configuration for the run. As a side effect, fix a race condition where the runner could end up with no diagnostic config (removed during run) - copy the diagnostic config instead of referencing/querying it by the id. Change-Id: Iedafa8f31a3bbd233d65818fe8de16add1e4d443 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -33,10 +33,13 @@ using namespace ProjectExplorer;
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
ClangTidyClazyRunControl::ClangTidyClazyRunControl(RunControl *runControl,
|
||||
Target *target,
|
||||
const FileInfos &fileInfos)
|
||||
ClangTidyClazyRunControl::ClangTidyClazyRunControl(
|
||||
RunControl *runControl,
|
||||
Target *target,
|
||||
const CppTools::ClangDiagnosticConfig &diagnosticConfig,
|
||||
const FileInfos &fileInfos)
|
||||
: ClangToolRunControl(runControl, target, fileInfos)
|
||||
, m_diagnosticConfig(diagnosticConfig)
|
||||
{
|
||||
setDisplayName("ClangTidyClazyRunner");
|
||||
init();
|
||||
@@ -47,7 +50,8 @@ ClangToolRunner *ClangTidyClazyRunControl::createRunner()
|
||||
QTC_ASSERT(!m_clangExecutable.isEmpty(), return 0);
|
||||
QTC_ASSERT(!m_clangLogFileDir.isEmpty(), return 0);
|
||||
|
||||
auto runner = new ClangTidyClazyRunner(m_clangExecutable,
|
||||
auto runner = new ClangTidyClazyRunner(m_diagnosticConfig,
|
||||
m_clangExecutable,
|
||||
m_clangLogFileDir,
|
||||
m_environment,
|
||||
this);
|
||||
|
||||
Reference in New Issue
Block a user