-
Notifications
You must be signed in to change notification settings - Fork 50
/
clang.dart
55 lines (51 loc) · 1.38 KB
/
clang.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import '../tool/tool.dart';
import '../tool/tool_resolver.dart';
/// The Clang compiler.
///
/// https://clang.llvm.org/
final Tool clang = Tool(
name: 'Clang',
defaultResolver: CliVersionResolver(
wrappedResolver: CliFilter(
cliArguments: ['--version'],
keepIf: ({required String stdout}) => !stdout.contains('Apple clang'),
wrappedResolver: PathToolResolver(
toolName: 'Clang',
executableName: 'clang',
),
),
),
);
/// The LLVM archiver.
///
/// https://llvm.org/docs/CommandGuide/llvm-ar.html
final Tool llvmAr = Tool(
name: 'LLVM archiver',
defaultResolver: CliVersionResolver(
wrappedResolver: ToolResolvers([
RelativeToolResolver(
toolName: 'LLVM archiver',
wrappedResolver: clang.defaultResolver!,
relativePath: Uri.file('llvm-ar'),
),
]),
),
);
/// The LLVM Linker.
///
/// https://lld.llvm.org/
final Tool lld = Tool(
name: 'LLD',
defaultResolver: CliVersionResolver(
wrappedResolver: ToolResolvers([
RelativeToolResolver(
toolName: 'LLD',
wrappedResolver: clang.defaultResolver!,
relativePath: Uri.file('ld.lld'),
),
]),
),
);