forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreprocess_if_expr.gni
49 lines (42 loc) · 1.28 KB
/
preprocess_if_expr.gni
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
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/python.gni")
import("//tools/grit/grit_defines.gni")
template("preprocess_if_expr") {
# TODO(crbug.com/1112471): Get this to run cleanly under Python 3.
python2_action(target_name) {
script = "//tools/grit/preprocess_if_expr.py"
if (defined(invoker.deps)) {
deps = invoker.deps
}
inputs = []
outputs = []
foreach(in_file, invoker.in_files) {
inputs += [ invoker.in_folder + "/" + in_file ]
outputs += [ invoker.out_folder + "/" + in_file ]
}
args = [
"--in-folder",
rebase_path(invoker.in_folder, root_build_dir),
"--out-folder",
rebase_path(invoker.out_folder, root_build_dir),
"--in-files",
] + invoker.in_files + grit_defines
if (defined(invoker.defines)) {
foreach(define, invoker.defines) {
args += [
"-D",
define,
]
}
}
if (defined(invoker.out_manifest)) {
args += [
"--out-manifest",
rebase_path(invoker.out_manifest, root_build_dir),
]
outputs += [ invoker.out_manifest ]
}
}
}