forked from qt-creator/qt-creator
ClangToolsUtils: Add isVFSOverlaySupported()
Remove ClangToolRunner::supportsVFSOverlay(). Move check for modified document and vfsOverlay into runner creator method, as it's called in the same cycle just before the runner is about to be started. Change-Id: I7a5df71bfa73c350862e4c7f9eae49773b6206b7 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -200,6 +200,19 @@ FilePath toolFallbackExecutable(ClangToolType tool)
|
||||
return findValidExecutable({toolShippedExecutable(tool), fallback});
|
||||
}
|
||||
|
||||
bool isVFSOverlaySupported(const FilePath &executable)
|
||||
{
|
||||
static QMap<FilePath, bool> vfsCapabilities;
|
||||
auto it = vfsCapabilities.find(executable);
|
||||
if (it == vfsCapabilities.end()) {
|
||||
QtcProcess p;
|
||||
p.setCommand({executable, {"--help"}});
|
||||
p.runBlocking();
|
||||
it = vfsCapabilities.insert(executable, p.allOutput().contains("vfsoverlay"));
|
||||
}
|
||||
return it.value();
|
||||
}
|
||||
|
||||
static void addBuiltinConfigs(ClangDiagnosticConfigsModel &model)
|
||||
{
|
||||
model.appendOrUpdate(builtinConfig());
|
||||
|
||||
Reference in New Issue
Block a user