From 313bbe3793c95af37e0c33f959b1154643387b05 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 16 Oct 2020 14:03:55 -0700 Subject: [PATCH] Define SK_VULKAN for clang-tidy runs 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 --- ci/bin/lint.dart | 6 ++++++ vulkan/vulkan_window.cc | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/bin/lint.dart b/ci/bin/lint.dart index 695473265701a..2f2f98abf2c8c 100644 --- a/ci/bin/lint.dart +++ b/ci/bin/lint.dart @@ -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 clangTidyDefineArgs = [ + "-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; } diff --git a/vulkan/vulkan_window.cc b/vulkan/vulkan_window.cc index 2c4618f06e796..49f8e5d606bcd 100644 --- a/vulkan/vulkan_window.cc +++ b/vulkan/vulkan_window.cc @@ -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