Define SK_VULKAN for clang-tidy runs (flutter/engine#21927)

When linting flutter/vulkan/vulkan_window.cc, the call to
GrDirectContext::MakeVulkan is undefined when SK_VULKAN is not defined,
triggering a lint error.

Bug: https://github.com/flutter/flutter/issues/68331
This commit is contained in:
Chris Bracken
2020-10-19 16:31:07 -07:00
committed by GitHub
parent 546df582bb
commit 939c3de58a
2 changed files with 6 additions and 2 deletions

View File

@@ -28,6 +28,11 @@ https://github.com/flutter/flutter/wiki/Engine-Clang-Tidy-Linter
const String issueUrlPrefix = 'https://github.com/flutter/flutter/issues';
/// Symbol definitions passed to clang-tidy.
const List<String> clangTidyDefineArgs = <String>[
"-DSK_VULKAN", // See: https://github.com/flutter/flutter/issues/68331
];
class Command {
Directory directory = Directory('');
String command = '';
@@ -46,6 +51,7 @@ String calcTidyArgs(Command command) {
String result = command.command;
result = result.replaceAll(RegExp(r'\S*clang/bin/clang'), '');
result = result.replaceAll(RegExp(r'-MF \S*'), '');
result += ' ' + clangTidyDefineArgs.join(' ');
return result;
}

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// FLUTTER_NOLINT: https://github.com/flutter/flutter/issues/68331
#include "vulkan_window.h"
#include <memory>