Move gn build file for sfntly from secondary tree into the main tree.
[chromium-blink-merge.git] / components / BUILD.gn
blobc0f6ad8b14d66ea32533b97494e9e07b92e5f1f1
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
8 import("//tools/grit/repack.gni")
10 # Collection of all components. You wouldn't link to this, but this is rather
11 # to reference the files so they can be compiled by the build system.
12 group("all_components") {
13   testonly = true  # You shouldn't actually link to this.
14   visibility = [ "//:*" ]  # Only for the root targets to bring in.
16   deps = [
17     "//components/auto_login_parser",
18     "//components/autofill/content/browser",
19     "//components/autofill/content/common",
20     "//components/autofill/content/renderer",
21     "//components/bookmarks/browser",
22     "//components/bookmarks/common",
23     "//components/bookmarks/managed",
24     "//components/bookmarks/test",
25     "//components/captive_portal",
26     "//components/cdm/browser",
27     "//components/cdm/common",
28     "//components/cdm/renderer",
29     "//components/cloud_devices/common",
30     "//components/component_updater",
31     "//components/content_settings/core/browser",
32     "//components/content_settings/core/common",
33     "//components/crash/app",
34     "//components/crash/browser",
35     "//components/crx_file",
36     "//components/data_reduction_proxy/core/browser",
37     "//components/data_reduction_proxy/core/common",
38     "//components/device_event_log",
39     "//components/devtools_http_handler",
40     "//components/dom_distiller/core",
41     "//components/domain_reliability",
42     "//components/enhanced_bookmarks",
43     "//components/favicon/core",
44     "//components/favicon_base",
45     "//components/feedback",
46     "//components/gcm_driver",
47     "//components/google/core/browser",
48     "//components/history/content/browser",
49     "//components/history/core/browser",
50     "//components/history/core/common",
51     "//components/history/core/test",
52     "//components/infobars/core",
53     "//components/invalidation",
54     "//components/json_schema",
55     "//components/keyed_service/content",
56     "//components/language_usage_metrics",
57     "//components/leveldb_proto",
58     "//components/login",
59     "//components/metrics",
60     "//components/navigation_interception",
61     "//components/navigation_metrics",
62     "//components/network_time",
63     "//components/omnibox",
64     "//components/onc",
65     "//components/os_crypt",
66     "//components/packed_ct_ev_whitelist",
67     "//components/pairing",
68     "//components/password_manager/content/browser",
69     "//components/password_manager/core/browser",
70     "//components/password_manager/core/common",
71     "//components/pdf/browser",
72     "//components/pdf/common",
73     "//components/pdf/renderer",
74     "//components/plugins/common",
75     "//components/plugins/renderer",
76     "//components/policy",
77     "//components/power",
78     "//components/precache/core",
79     "//components/precache/content",
80     "//components/pref_registry",
81     "//components/query_parser",
82     "//components/rappor",
83     "//components/renderer_context_menu",
84     "//components/resources:components_resources",
85     "//components/search",
86     "//components/search_engines",
87     "//components/search_provider_logos",
88     "//components/sessions:sessions_content",
89     "//components/signin/core/browser",
90     "//components/startup_metric_utils",
91     "//components/strings",
92     "//components/sync_driver",
93     "//components/tracing",
94     "//components/translate/content/browser",
95     "//components/translate/content/common",
96     "//components/translate/content/renderer",
97     "//components/translate/core/browser",
98     "//components/translate/core/common",
99     "//components/ui/zoom:ui_zoom",
100     "//components/undo",
101     "//components/update_client",
102     "//components/url_fixer",
103     "//components/url_matcher",
104     "//components/user_manager",
105     "//components/user_prefs",
106     "//components/variations",
107     "//components/visitedlink/browser",
108     "//components/visitedlink/common",
109     "//components/visitedlink/renderer",
110     "//components/wallpaper",
111     "//components/web_cache/browser",
112     "//components/web_cache/common",
113     "//components/web_cache/renderer",
114     "//components/web_modal",
115     "//components/web_resource",
116     "//components/webcrypto",
117     "//components/webdata/common",
118     "//components/webui_generator",
119     "//components/wifi",
120     "//components/wifi_sync",
121   ]
123   if (!is_android && !is_ios) {
124     deps += [
125       "//components/proximity_auth",
126       "//components/proximity_auth/cryptauth",
127     ]
128   }
130   if (!enable_configuration_policy) {
131     deps -= [ "//components/policy" ]
132   }
134   if (!is_win && !is_mac) {
135     deps -= [ "//components/wifi" ]
136   }
137   if (!is_chromeos) {
138     deps -= [
139       "//components/pairing",
140       "//components/wifi_sync",
141     ]
142   }
143   if (is_ios) {
144     deps -= [
145       "//components/history/content/browser",
146       "//components/keyed_service/content",
147       "//components/webui_generator",
148     ]
149   }
151   if (!enable_plugins) {
152     deps -= [
153       "//components/pdf/browser",
154       "//components/pdf/common",
155       "//components/pdf/renderer",
156     ]
157   }
159   if (is_android) {
160     deps -= [
161       "//components/autofill/content/browser",  # Blocked on content/blink.
162       "//components/autofill/content/common",  # Blocked on content.
163       "//components/autofill/content/renderer",  # Blocked on content/blink.
164       "//components/crash/app",  # Should work, needs checking.
165       "//components/crash/browser",  # Should work, needs checking.
166       "//components/captive_portal",  # Should work, needs checking.
167       "//components/cloud_devices/common",  # Should work, needs checking.
168       "//components/cdm/browser",  # Blocked on content.
169       "//components/cdm/common",  # Blocked on content.
170       "//components/cdm/renderer",  # Blocked on content.
171       "//components/data_reduction_proxy/core/browser",  # Should work, needs checking.
172       "//components/data_reduction_proxy/core/common",  # Should work, needs checking.
173       "//components/dom_distiller/core",  # Blocked on content.
174       "//components/domain_reliability",  # Blocked on content.
175       "//components/favicon/core",  # Blocked on keyed service.
176       "//components/favicon_base",  # Should work, needs checking.
177       "//components/feedback",  # Blocked on content.
178       "//components/gcm_driver",  # Should work, needs checking.
179       "//components/google/core/browser",  # Should work, needs checking.
180       "//components/history/core/browser",  # Should work, needs checking.
181       "//components/history/core/common",  # Should work, needs checking.
182       "//components/history/core/test",  # Should work, needs checking.
183       "//components/infobars/core",  # Should work, needs checking.
184       "//components/invalidation",  # Should work, needs checking.
185       "//components/json_schema",  # Should work, needs checking.
186       "//components/keyed_service/content",  # Blocked on content.
187       "//components/navigation_interception",  # Blocked on content.
188       "//components/omnibox",  # Should work, needs checking.
189       "//components/password_manager/content/browser",  # Blocked on content.
190       "//components/password_manager/core/browser",  # Should work, needs checking.
191       "//components/password_manager/core/common",  # Should work, needs checking.
192       "//components/plugins/renderer",  # Blocked on blink.
193       "//components/power",  # Blocked on content.
194       "//components/policy",  # Blocked on content (indirectly via autofill).
195       "//components/precache/content",  # Blocked on content.
196       "//components/precache/core",  # Should work, needs checking.
197       "//components/rappor",  # Should work, needs checking.
198       "//components/renderer_context_menu",  # Blocked on content.
199       "//components/search_engines",  # Should work, needs checking.
200       "//components/search_provider_logos",  # Should work, needs checking.
201       "//components/sessions:sessions_content",  # Blocked on content.
202       "//components/signin/core/browser",  # Should work, needs checking.
203       "//components/translate/content/browser",  # Blocked on content.
204       "//components/translate/content/common",  # Blocked on content.
205       "//components/translate/content/renderer",  # Blocked on content.
206       "//components/user_prefs",  # Blocked on content.
207       "//components/visitedlink/browser",  # Blocked on content.
208       "//components/visitedlink/common",  # Blocked on content.
209       "//components/visitedlink/renderer",  # Blocked on blink
210       "//components/web_cache/browser",  # Blocked on content and blink.
211       "//components/web_cache/renderer",  # Blocked on content and blink.
212       "//components/web_modal",  # Blocked on content.
213     ]
214   }
216   if (!is_ios && !is_android) {
217     deps += [
218       "//components/copresence",
219       "//components/storage_monitor",
220     ]
221   }
223   if (!is_ios) {
224     deps += [
225       "//components/app_modal",
226       "//components/browsing_data",
227     ]
228   }
230   if (toolkit_views) {
231     deps += [ "//components/constrained_window" ]
232   }
235 # To add a unit test to this target, make a "unit_test" source_set in your
236 # component (it's important to use a source_set instead of a static library or
237 # no tests will run) and add a reference here. You can add more than one unit
238 # test target if convenient.
239 test("components_unittests") {
240   sources = [
241     "test/run_all_unittests.cc",
242   ]
244   # Add only ":unit_tests" dependencies here. If your tests have dependencies
245   # (this would at least include the component itself), they should be on the
246   # test source set and not here.
247   deps = [
248     "//components/auto_login_parser:unit_tests",
249     "//components/autofill/content/browser:unit_tests",
250     "//components/autofill/core/browser:unit_tests",
251     "//components/autofill/core/common:unit_tests",
252     "//components/bookmarks/browser:unit_tests",
253     "//components/bookmarks/managed:unit_tests",
254     "//components/captive_portal:unit_tests",
255     "//components/cloud_devices/common:unit_tests",
256     "//components/content_settings/core/browser:unit_tests",
257     "//components/content_settings/core/common:unit_tests",
258     "//components/crx_file:unit_tests",
259     "//components/data_reduction_proxy/content/browser:unit_tests",
260     "//components/data_reduction_proxy/core/browser:unit_tests",
261     "//components/data_reduction_proxy/core/common:unit_tests",
262     "//components/device_event_log:unit_tests",
263     "//components/devtools_http_handler:unit_tests",
264     "//components/dom_distiller/core:unit_tests",
265     "//components/domain_reliability:unit_tests",
266     "//components/favicon_base:unit_tests",
267     "//components/google/core/browser:unit_tests",
268     "//components/invalidation:unittests",
269     "//components/login:unit_tests",
270     "//components/metrics:unit_tests",
271     "//components/omnibox:unit_tests",
272     "//components/ownership:unit_tests",
273     "//components/packed_ct_ev_whitelist:unit_tests",
274     "//components/undo:unit_tests",
275     "//components/update_client:unit_tests",
276     "//components/variations:unit_tests",
277     "//components/web_resource:unit_tests",
278     "//components/webcrypto:unit_tests",
279     "//components/webdata/common:unit_tests",
281     # These are the deps required by the code in this target.
282     "//base",
283     "//base/test:test_support",
284     "//content/test:test_support",
285     "//ui/base",
286   ]
287   data_deps = [ ":components_tests_pak" ]
289   if (!is_android && !is_ios) {
290     deps += [ "//components/proximity_auth:unit_tests" ]
291   }
293   # TODO(GYP) need this target.
294   #'breakpad/app/crash_keys_win_unittest.cc',
296   # Precache tests need these defines.
297   #configs += [ "//components/precache/core:precache_config" ]
299   if (toolkit_views) {
300     # TODO(GYP) enable this as above.
301     #deps += [ "//components/constrained_window:unit_tests" ]
302   }
303   if (is_win) {
304     deps += [ "//components/browser_watcher:unit_tests" ]
305   }
306   if (is_ios) {
307     deps -= [ "//components/devtools_http_handler:unit_tests" ]
308   }
311 repack("components_tests_pak") {
312   sources = [
313     "$root_gen_dir/components/components_resources.pak",
314     "$root_gen_dir/components/strings/components_strings_en-US.pak",
315     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
316     "$root_gen_dir/ui/resources/webui_resources.pak",
317     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
318     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
319   ]
321   output = "$root_out_dir/components_tests_resources.pak"
323   deps = [
324     "//components/resources",
325     "//components/strings",
326     "//ui/resources",
327     "//ui/strings",
328   ]
331 test("components_browsertests") {
332   sources = [
333     "autofill/content/browser/risk/fingerprint_browsertest.cc",
334     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
335     "dom_distiller/content/distillable_page_utils_browsertest.cc",
336     "dom_distiller/content/distiller_page_web_contents_browsertest.cc",
337     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
338   ]
340   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
342   deps = [
343     "autofill/content/browser",
344     "autofill/content/renderer",
345     "content_settings/core/common",
346     "dom_distiller/content",
347     "dom_distiller/core",
348     "dom_distiller/core:test_support",
349     "password_manager/content/browser",
350     "password_manager/content/common",
351     "password_manager/content/renderer",
352     "strings",
353     "//base",
354     "//base/test:test_support",
355     "//content/test:browsertest_support",
356     "//content/test:test_support",
358     "//testing/gmock",
359     "//testing/gtest",
360     "//ui/base",
361   ]
363   data_deps = [ ":components_tests_pak" ]
365   if (is_android) {
366     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
367   }
369   if (is_linux) {
370     # content_extractor_browsertest is a standalone content extraction tool built as
371     # a MANUAL component_browsertest.
372     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
373     deps += [
374       "pref_registry:test_support",
375       "//base:prefs_test_support",
376     ]
377   }
380 test("components_perftests") {
381   sources = [
382     "visitedlink/test/visitedlink_perftest.cc",
383   ]
385   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
386   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
388   deps = [
389     "//base",
390     "//base/test:test_support_perf",
391     "//testing/gtest",
392     "//content/test:test_support",
393     "//components/visitedlink/browser",
394   ]