forked from qt-creator/qt-creator
ClangTools: Work around clazy-standalone behavior fluctuation
Some versions expect an argument after the -supported-checks-json option, and some don't. They are not easily identifiable, so we try both versions of the command line. Change-Id: I5b265e4ddd4a21c238228dafc60cbc09194f23cc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -98,8 +98,13 @@ static QStringList queryClangTidyChecks(const QString &executable,
|
||||
|
||||
static ClazyChecks querySupportedClazyChecks(const QString &executablePath)
|
||||
{
|
||||
const CommandLine commandLine(executablePath, {"-supported-checks-json"});
|
||||
const QString jsonOutput = runExecutable(commandLine);
|
||||
static const QString queryFlag = "-supported-checks-json";
|
||||
QString jsonOutput = runExecutable(CommandLine(executablePath, {queryFlag}));
|
||||
|
||||
// Some clazy 1.6.x versions have a bug where they expect an argument after the
|
||||
// option.
|
||||
if (jsonOutput.isEmpty())
|
||||
jsonOutput = runExecutable(CommandLine(executablePath, {queryFlag, "dummy"}));
|
||||
if (jsonOutput.isEmpty())
|
||||
return {};
|
||||
|
||||
|
Reference in New Issue
Block a user