Disable stuck key detection on ChromeOS.
[chromium-blink-merge.git] / chrome / common / BUILD.gn
blob751349dd665205e7cc5f4b7cd5e97bf364d25ea9
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("//tools/grit/grit_rule.gni")
6 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
8 gypi_values = exec_script("//build/gypi_to_gn.py",
9                           [ rebase_path("../chrome_common.gypi") ],
10                           "scope",
11                           [ "../chrome_common.gypi" ])
13 # GYP version: chrome/chrome_resources.gyp:chrome_resources
14 #              (generate_common_resources action)
15 grit("resources") {
16   source = "common_resources.grd"
17   output_dir = "$root_gen_dir/chrome"
18   output_name = "common_resources"
19   outputs = [
20     "grit/common_resources.h",
21     "common_resources.pak",
22   ]
25 # GYP version: chrome/chrome_resources.gyp:chrome_resources
26 #              (generate_extensions_api_resources action)
27 if (enable_extensions) {
28   grit("extensions_api_resources") {
29     source = "extensions_api_resources.grd"
30     output_dir = "$root_gen_dir/chrome"
31     outputs = [
32       "grit/extensions_api_resources.h",
33       "extensions_api_resources.pak",
34     ]
35   }
38 # GYP version: chrome/chrome_common.gyp:common
39 static_library("common") {
40   sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
41   defines = []
43   configs += [ "//build/config/compiler:wexit_time_destructors" ]
45   public_deps = [
46     "//chrome/common:constants",
47     "//chrome/common/net",
48     "//chrome/common/safe_browsing:proto",
49   ]
50   deps = [
51     ":version",
52     "//base:base",
53     "//base:i18n",
54     "//base:prefs",
55     "//base:base_static",
56     "//chrome:resources",
57     "//chrome:strings",
58     "//chrome/app/theme:theme_resources",
59     "//chrome/installer/util",
60     "//components/cloud_devices/common",
61     "//components/component_updater",
62     "//components/content_settings/core/common",
63     "//components/favicon_base",
64     "//components/json_schema",
65     "//components/metrics",
66     "//components/policy:policy_component_common",
67     "//components/translate/core/common",
68     "//components/variations",
69     "//content/public/common",
70     "//crypto",
71     "//extensions/common:common_constants",
72     "//net",
73     "//skia",
74     "//third_party/icu",
75     "//third_party/libxml",
76     "//third_party/sqlite",
77     "//third_party/zlib:zip",
78     "//ui/resources:resources",
79     "//url",
80   ]
82   if (is_ios) {
83     sources += [
84       # Use this Mac file that was filtered out.
85       "chrome_version_info_mac.mm",
86     ]
87   } else {
88     # Non-iOS.
89     deps += [
90       ":mojo_bindings",
91       "//components/visitedlink/common",
92       "//components/autofill/content/common",
93       "//components/autofill/core/common",
94       "//components/password_manager/content/common",
95       "//components/password_manager/core/common",
96       "//components/signin/core/common",
97       "//components/translate/content/common",
98       "//ipc",
99       "//third_party/re2",
100       "//third_party/widevine/cdm:version_h",
101     ]
102     public_deps += [ "//third_party/mojo/src/mojo/public/cpp/bindings" ]
103   }
105   if (enable_extensions) {
106     sources += rebase_path(gypi_values.chrome_common_extensions_sources,
107                            ".",
108                            "//chrome")
109     deps += [
110       "//device/usb",
111       "//chrome/common/extensions/api",
112       "//extensions/common",
113       "//extensions/common/api",
114       "//extensions:extensions_resources",
115       "//extensions/strings",
116       "//media/cast:net",
117     ]
118     if (is_chromeos) {
119       sources +=
120           rebase_path(gypi_values.chrome_common_extensions_chromeos_sources,
121                       ".",
122                       "//chrome")
123     }
124   }
126   if (is_win || is_mac) {
127     sources +=
128         rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
129     deps += [ "//breakpad:client" ]
130   }
131   if (is_win || is_mac || is_chromeos) {
132     if (use_openssl) {
133       sources += rebase_path(
134               gypi_values.chrome_common_networking_private_sources_openssl,
135               ".",
136               "//chrome")
138       # networking_private_crypto_openssl.cc depends on boringssl.
139       deps += [ "//third_party/boringssl" ]
140     } else {
141       sources +=
142           rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
143                       ".",
144                       "//chrome")
145     }
146   }
147   if (is_mac) {
148     sources +=
149         rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
150     deps += [ ":app_mode_app_support" ]
151   }
153   if (enable_nacl) {
154     deps += [ "//components/nacl:nacl_common" ]
155   }
157   # Printing.
158   if (enable_basic_printing || enable_print_preview) {
159     deps += [
160       "//components/printing/common:printing_common",
161       "//printing",
162     ]
163     if (enable_print_preview) {
164       # Full printing support.
165       sources += rebase_path(gypi_values.chrome_common_service_process_sources,
166                              ".",
167                              "//chrome")
168     }
169   }
171   if (enable_service_discovery) {
172     sources += [
173       "local_discovery/service_discovery_client.cc",
174       "local_discovery/service_discovery_client.h",
175     ]
176   }
177   if (enable_mdns) {
178     sources += [
179       "local_discovery/service_discovery_client_impl.cc",
180       "local_discovery/service_discovery_client_impl.h",
181     ]
182   }
184   if (is_android) {
185     sources -= [
186       "badge_util.cc",
187       "chrome_version_info_posix.cc",
188       "icon_with_badge_image_source.cc",
189       "media_galleries/metadata_types.h",
190       "spellcheck_common.cc",
191     ]
192   } else {
193     # Non-Android.
194     sources +=
195         rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
196   }
198   if (is_chromeos) {
199     sources -= [ "chrome_version_info_posix.cc" ]
200   }
202   if (is_win) {
203     deps += [
204       "//components/dom_distiller/core",  # Needed by chrome_content_client.cc.
205       "//third_party/wtl",
206     ]
207   }
209   if (enable_mdns) {
210     sources += [ "local_discovery/local_discovery_messages.h" ]
211   }
213   if (is_mac) {
214     sources -= [ "chrome_version_info_posix.cc" ]
215     deps += [
216       "//third_party/mach_override",
217       "//third_party/google_toolbox_for_mac",
218     ]
219   }
221   if (enable_plugins) {
222     sources += [
223       "pepper_flash.cc",
224       "pepper_flash.h",
225       "ppapi_utils.cc",
226       "ppapi_utils.h",
227     ]
228     deps += [ "//third_party/adobe/flash:flapper_version_h" ]
229   }
230   if (enable_plugins && enable_extensions) {
231     sources += [
232       "pepper_permission_util.cc",
233       "pepper_permission_util.h",
234     ]
235   }
236   if (!enable_webrtc) {
237     sources -= [ "media/webrtc_logging_messages.h" ]
238   }
239   if (enable_configuration_policy) {
240     deps += [ "//components/policy" ]
241   }
243   if (safe_browsing_mode == 1) {
244     sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
245                            ".",
246                            "//chrome")
247   }
250 # This target allows other targets to depend on result_codes.h which is a
251 # header-only dependency, without bringing in all of content.
252 source_set("result_codes") {
253   sources = [
254     "chrome_result_codes.h",
255   ]
258 import("//chrome/version.gni")
259 process_version("version") {
260   visibility = [ ":common" ]
261   template_file = "chrome_version_info_values.h.version"
262   output = "$target_gen_dir/chrome_version_info_values.h"
265 process_version("make_chrome_version") {
266   template_file = "chrome_version.cc.version"
267   output = "$target_gen_dir/chrome_version.cc"
270 # GN version: chrome/common_constants.gyp:common_constants
271 static_library("constants") {
272   sources = [
273     "chrome_constants.cc",
274     "chrome_constants.h",
275     "chrome_icon_resources_win.cc",
276     "chrome_icon_resources_win.h",
277     "chrome_paths.cc",
278     "chrome_paths.h",
279     "chrome_paths_android.cc",
280     "chrome_paths_internal.h",
281     "chrome_paths_linux.cc",
282     "chrome_paths_mac.mm",
283     "chrome_paths_win.cc",
284     "chrome_switches.cc",
285     "chrome_switches.h",
286     "env_vars.cc",
287     "env_vars.h",
288     "net/test_server_locations.cc",
289     "net/test_server_locations.h",
290     "pref_font_script_names-inl.h",
291     "pref_font_webkit_names.h",
292     "pref_names.cc",
293     "pref_names.h",
294     "widevine_cdm_constants.cc",
295     "widevine_cdm_constants.h",
296   ]
298   deps = [
299     ":make_chrome_version",
300     "//base",
301     "//base/third_party/dynamic_annotations",
302     "//components/bookmarks/common",
303     "//third_party/widevine/cdm:version_h",
304   ]
306   if (enable_nacl) {
307     deps += [ "//components/nacl:nacl_switches" ]
308   }
311 source_set("test_support") {
312   testonly = true
313   visibility = [ "//chrome/test:test_support" ]
315   sources = []
317   deps = [
318     ":common",
319     "//base",
320     "//testing/gtest",
321   ]
323   if (is_win || is_mac) {
324     sources += [
325       "media_galleries/picasa_test_util.cc",
326       "media_galleries/picasa_test_util.h",
327       "media_galleries/pmp_test_util.cc",
328       "media_galleries/pmp_test_util.h",
329     ]
330   }
332   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
334   if (enable_extensions) {
335     sources += [
336       "extensions/extension_test_util.cc",
337       "extensions/extension_test_util.h",
338     ]
339   }
342 # GN version: chrome/chrome.gyp:app_mode_app_support
343 static_library("app_mode_app_support") {
344   sources = [
345     "mac/app_mode_chrome_locator.h",
346     "mac/app_mode_chrome_locator.mm",
347     "mac/app_mode_common.h",
348     "mac/app_mode_common.mm",
349   ]
351   deps = [
352     ":constants",
353     "//base",
354   ]
357 mojom("mojo_bindings") {
358   sources = [
359     "resource_usage_reporter.mojom",
360   ]