[DevTools] Move DispatchOnDevToolsFrontend to embedder.
[chromium-blink-merge.git] / chrome / common / BUILD.gn
blobafce07b7b0ba7378a3c256a772b914413dafa682
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")
7 gypi_values = exec_script(
8     "//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   outputs = [
18     "grit/common_resources.h",
19     "common_resources.pak",
20   ]
23 # GYP version: chrome/chrome_resources.gyp:chrome_resources
24 #              (generate_extensions_api_resources action)
25 grit("extensions_api_resources") {
26   source = "extensions_api_resources.grd"
27   outputs = [
28     "grit/extensions_api_resources.h",
29     "extensions_api_resources.pak",
30   ]
33 # GYP version: chrome/chrome_common.gyp:common
34 static_library("common") {
35   sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
36   defines = []
38   configs += [ "//build/config/compiler:wexit_time_destructors" ]
40   deps = [
41     ":version",
42     "//base:base",
43     "//base:i18n",
44     "//base:prefs",
45     "//base:base_static",
46     "//chrome:resources",
47     "//chrome:strings",
48     "//chrome/app/theme:theme_resources",
49     "//chrome/common:constants",
50     "//chrome/common/net",
51     "//chrome/common/safe_browsing:proto",
52     "//components/cloud_devices/common",
53     "//components/content_settings/core/common",
54     "//components/json_schema",
55     "//components/metrics",
56     "//components/policy:policy_component_common",
57     "//components/translate/core/common",
58     "//components/variations",
59     "//content/public/common",
60     "//crypto",
61     "//extensions:extensions_resources",
62     "//extensions/strings",
63     "//net",
64     "//skia",
65     "//third_party/icu",
66     "//third_party/libxml",
67     "//third_party/sqlite",
68     "//third_party/zlib:zip",
69     "//ui/resources:resources",
70     "//url",
71     #":installer_util",  TODO(GYP)
72     #"//media/cast/cast.gyp:cast_transport",  TODO(GYP)
73   ]
75   if (is_ios) {
76     sources += [
77       # Use this Mac file that was filtered out.
78       "chrome_version_info_mac.mm",
79     ]
80   } else {
81     # Non-iOS.
82     deps += [
83       "//chrome/common/extensions/api",
84       "//components/visitedlink/common",
85       "//components/autofill/content/common",
86       "//components/autofill/core/common",
87       "//components/password_manager/core/common",
88       "//components/signin/core/common",
89       "//components/translate/content/common",
90       "//extensions/common/api",
91       "//ipc",
92       "//third_party/adobe/flash:flapper_version_h",
93       "//third_party/re2",
94       "//third_party/widevine/cdm:version_h",
95       #'<(DEPTH)/extensions/extensions.gyp:extensions_common',  TODO(GYP)
96     ]
97   }
99   if (enable_extensions) {
100     sources += rebase_path(
101         gypi_values.chrome_common_extensions_sources,
102         ".", "//chrome")
103     deps += [
104       "//device/bluetooth",
105       "//device/usb",
106     ]
107   }
109   if (is_win || is_mac) {
110     sources += rebase_path(
111         gypi_values.chrome_common_win_mac_sources,
112         ".", "//chrome")
113     if (use_openssl) {
114       sources -= [
115         "extensions/api/networking_private/networking_private_crypto_nss.cc",
116       ]
117       # networking_private_crypto_openssl.cc depends on boringssl.
118       deps += [
119         "//third_party/boringssl",
120       ]
121     } else {
122       sources -= [
123         "extensions/api/networking_private/networking_private_crypto_openssl.cc",
124       ]
125     }
126     deps += [ "//breakpad:client" ]
127   }
128   if (is_mac) {
129     sources += rebase_path(
130         gypi_values.chrome_common_mac_sources,
131         ".", "//chrome")
132   }
134   if (enable_nacl) {
135     deps += [
136       #'<(DEPTH)/components/nacl.gyp:nacl_common',  TODO(GYP)
137     ]
138     sources += [
139       "extensions/manifest_handlers/nacl_modules_handler.cc",
140       "extensions/manifest_handlers/nacl_modules_handler.h",
141     ]
142   }
144   # Printing.
145   if (printing_mode == 0) {
146     sources -= [
147       "print_messages.cc",
148       "print_messages.h",
149     ]
150   } else {
151     deps += [ "//printing" ]
152     if (printing_mode == 1) {
153       # Full printing support.
154       sources += rebase_path(
155           gypi_values.chrome_common_service_process_sources,
156           ".", "//chrome")
157     }
158   }
160   if (enable_service_discovery) {
161     sources += [
162       "local_discovery/service_discovery_client.cc",
163       "local_discovery/service_discovery_client.h",
164     ]
165   }
166   if (enable_mdns) {
167     sources += [
168       "local_discovery/service_discovery_client_impl.cc",
169       "local_discovery/service_discovery_client_impl.h",
170     ]
171   }
173   if (is_android) {
174     sources -= [
175       "badge_util.cc",
176       "chrome_version_info_posix.cc",
177       "extensions/manifest_handlers/minimum_chrome_version_checker.cc",
178       "icon_with_badge_image_source.cc",
179       "media_galleries/metadata_types.h",
180       "spellcheck_common.cc",
181     ]
182   } else {
183     # Non-Android.
184     sources += rebase_path(
185         gypi_values.chrome_common_importer_sources,
186         ".", "//chrome")
187   }
189   if (is_win) {
190     deps += [ "//third_party/wtl" ]
191   }
193   if (enable_mdns) {
194     sources += [ "local_discovery/local_discovery_messages.h" ]
195   }
197   if (is_chromeos) {
198     sources -= [ "chrome_version_info_linux.cc" ]
199   }
201   if (is_mac) {
202     sources -= [
203       "chrome_version_info_posix.cc",
204     ]
205     deps += [
206       "//third_party/mach_override",
207       "//third_party/google_toolbox_for_mac",
208     ]
209   }
211   if (enable_remoting) {
212     #deps += [ '../remoting/remoting.gyp:remoting_client_plugin' ]  TODO(GYP)
213   }
214   if (!enable_plugins) {
215     sources -= [ "pepper_permission_util.cc" ]
216   }
217   if (!enable_webrtc) {
218     sources -= [ "media/webrtc_logging_messages.h" ]
219   }
220   if (enable_configuration_policy) {
221     deps += [ "//components/policy" ]
222   }
224   if (safe_browsing_mode == 1) {
225     defines += [ "FULL_SAFE_BROWSING" ]
226     sources += rebase_path(
227         gypi_values.chrome_common_full_safe_browsing_sources,
228         ".", "//chrome")
229   }
230   if (safe_browsing_mode == 2) {
231     defines += [ "MOBILE_SAFE_BROWSING" ]
232   }
235 if (is_linux) {
236   action("version") {
237     visibility = ":common"
238     script = "//build/util/version.py"
240     lastchange_path = "//build/util/LASTCHANGE"
241     version_path = "//chrome/VERSION"
242     template_input_path = "chrome_version_info_posix.h.version"
243     if (is_chrome_branded) {
244       branding_path = "//chrome/app/theme/google_chrome/BRANDING"
245     } else {
246       branding_path = "//chrome/app/theme/chromium/BRANDING"
247     }
249     inputs = [
250       version_path,
251       template_input_path,
252       lastchange_path,
253       branding_path,
254     ]
256     outfile = "$target_gen_dir/chrome_version_info_posix.h"
257     outputs = [ outfile ]
259     args = [
260       "-f", rebase_path(version_path, root_build_dir),
261       "-f", rebase_path(branding_path, root_build_dir),
262       "-f", rebase_path(lastchange_path, root_build_dir),
263       rebase_path(template_input_path, root_build_dir),
264       rebase_path(outfile, root_build_dir),
265     ]
266   }
267 } else {
268   # Other platforms have a different way to do versioning.
269   group("version") {
270   }
273 # GN version: chrome/common_constants.gyp:common_constants
274 static_library("constants") {
275   sources = [
276     "chrome_constants.cc",
277     "chrome_constants.h",
278     "chrome_icon_resources_win.cc",
279     "chrome_icon_resources_win.h",
280     "chrome_paths.cc",
281     "chrome_paths.h",
282     "chrome_paths_android.cc",
283     "chrome_paths_internal.h",
284     "chrome_paths_linux.cc",
285     "chrome_paths_mac.mm",
286     "chrome_paths_win.cc",
287     "chrome_switches.cc",
288     "chrome_switches.h",
289     "env_vars.cc",
290     "env_vars.h",
291     "net/test_server_locations.cc",
292     "net/test_server_locations.h",
293     "pref_font_script_names-inl.h",
294     "pref_font_webkit_names.h",
295     "pref_names.cc",
296     "pref_names.h",
297     "widevine_cdm_constants.cc",
298     "widevine_cdm_constants.h",
299   ]
301   deps = [
302     "//base",
303     "//base/third_party/dynamic_annotations",
304     "//components/bookmarks/common",
305     "//third_party/widevine/cdm:version_h",
306   ]
308   if (enable_nacl) {
309     deps += [
310       #'../components/nacl.gyp:nacl_switches',  TODO(GYP)
311     ]
312   }