Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 25d8fa5

Browse files
authored
Define SK_VULKAN for clang-tidy runs (#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: flutter/flutter#68331
1 parent 6fdcdd9 commit 25d8fa5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ci/bin/lint.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ https://github.com/flutter/flutter/wiki/Engine-Clang-Tidy-Linter
2828

2929
const String issueUrlPrefix = 'https://github.com/flutter/flutter/issues';
3030

31+
/// Symbol definitions passed to clang-tidy.
32+
const List<String> clangTidyDefineArgs = <String>[
33+
"-DSK_VULKAN", // See: https://github.com/flutter/flutter/issues/68331
34+
];
35+
3136
class Command {
3237
Directory directory = Directory('');
3338
String command = '';
@@ -46,6 +51,7 @@ String calcTidyArgs(Command command) {
4651
String result = command.command;
4752
result = result.replaceAll(RegExp(r'\S*clang/bin/clang'), '');
4853
result = result.replaceAll(RegExp(r'-MF \S*'), '');
54+
result += ' ' + clangTidyDefineArgs.join(' ');
4955
return result;
5056
}
5157

vulkan/vulkan_window.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// FLUTTER_NOLINT: https://github.com/flutter/flutter/issues/68331
6-
75
#include "vulkan_window.h"
86

97
#include <memory>

0 commit comments

Comments
 (0)