forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
177 lines (148 loc) · 4.79 KB
/
BUILD.gn
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/config.gni")
import("//build/config/features.gni")
import("//components/safe_browsing/buildflags.gni")
import("//components/supervised_user/buildflags.gni")
import("//pdf/features.gni")
import("//printing/buildflags/buildflags.gni")
import("//tools/grit/grit_rule.gni")
declare_args() {
# Generating the credits page requires a filesystem traversal for licenses
# that is slow in some environments.
generate_about_credits = is_official_build
}
if (is_android) {
import("//build/config/android/rules.gni")
}
if (is_ios) {
import("//build/config/ios/bundle_data_from_filelist.gni")
}
about_credits_file = "$target_gen_dir/about_credits.html"
group("resources") {
public_deps = [
":components_resources",
":components_scaled_resources",
":dev_ui_components_resources",
"../chrome_urls_ui/resources:resources",
"../flags_ui/resources:resources",
"../signin/core/browser/resources",
"../version_ui/resources:resources",
]
}
grit("components_resources") {
source = "components_resources.grd"
inputs = [ about_credits_file ]
outputs = [
"grit/components_resources.h",
"components_resources.pak",
]
output_dir = "$root_gen_dir/components"
use_brotli = true
grit_flags = [
"-E",
"about_credits_file=" + rebase_path(about_credits_file, root_build_dir),
]
defines = [
"enable_pdf=$enable_pdf",
"enable_printing=$enable_printing",
"enable_print_preview=$enable_print_preview",
"enable_supervised_users=$enable_supervised_users",
"safe_browsing_mode=$safe_browsing_mode",
"is_fuchsia=$is_fuchsia",
"use_blink=$use_blink",
]
deps = [
":about_credits",
"//components/neterror/resources:bundle_js",
"//components/security_interstitials/content/resources:build_ts",
"//components/security_interstitials/core/browser/resources:bundle_js",
]
if (use_blink) {
deps += [ "//components/resources/ssl/ssl_error_assistant:make_ssl_error_assistant_protobuf" ]
}
if (safe_browsing_mode > 0) {
deps += [
"//components/safe_browsing/content/resources:make_file_types_protobuf",
]
}
if (is_android && safe_browsing_mode == 2) {
deps += [ "//components/safe_browsing/content/resources/real_time_url_checks_allowlist:make_real_time_url_allowlist_protobuf" ]
}
}
grit("dev_ui_components_resources") {
source = "dev_ui_components_resources.grd"
outputs = [
"grit/dev_ui_components_resources.h",
"dev_ui_components_resources.pak",
]
deps = [
"//components/crash/core/browser/resources:build_ts",
"//components/local_state:build",
]
output_dir = "$root_gen_dir/components"
}
grit("components_scaled_resources") {
source = "components_scaled_resources.grd"
outputs = [
"grit/components_scaled_resources.h",
"grit/components_scaled_resources_map.cc",
"grit/components_scaled_resources_map.h",
"components_resources_100_percent.pak",
"components_resources_200_percent.pak",
"components_resources_300_percent.pak",
]
output_dir = "$root_gen_dir/components"
}
if (generate_about_credits) {
action("about_credits") {
script = "//tools/licenses/licenses.py"
depfile = "$target_gen_dir/$target_name.d"
inputs = [
"../about_ui/resources/about_credits.tmpl",
"../about_ui/resources/about_credits_entry.tmpl",
"../about_ui/resources/about_credits_reciprocal.tmpl",
]
outputs = [ about_credits_file ]
args = [
"--target-os=$target_os",
"--depfile",
rebase_path(depfile, root_build_dir),
"credits",
rebase_path(about_credits_file, root_build_dir),
]
# Defined by downstream projects.
if (defined(extra_third_party_notice_dirs)) {
args += [ "--extra-third-party-dirs=$extra_third_party_notice_dirs" ]
}
}
} else {
copy("about_credits") {
sources = [ "sample_credits.html" ]
outputs = [ about_credits_file ]
}
}
if (is_android) {
source_set("android_resources") {
sources = [
"android/autofill_resource_id.h",
"android/blocked_content_resource_id.h",
"android/page_info_resource_id.h",
"android/permissions_resource_id.h",
"android/sms_resource_id.h",
"android/theme_resources.h",
"android/webxr_resource_id.h",
]
public_deps = [ "//device/vr/buildflags" ]
}
}
if (is_ios) {
bundle_data_from_filelist("terms_resources") {
# On iOS, the terms of service file need to be loaded from the application
# bundle, not from a datapack. As GetTermsOfServicePath() returns path to
# those files, they are added to the bundle resources dir.
filelist_name = "terms_resources.filelist"
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
}