Revert 291214 "Fixes three crashes" in an attempt to find the cause of Athena related...
[chromium-blink-merge.git] / chrome / common / BUILD.gn
blobd489c05c38d6bd34f50af52b6bfb07d53ba4f6aa
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   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 grit("extensions_api_resources") {
28   source = "extensions_api_resources.grd"
29   output_dir = "$root_gen_dir/chrome"
30   outputs = [
31     "grit/extensions_api_resources.h",
32     "extensions_api_resources.pak",
33   ]
36 # GYP version: chrome/chrome_common.gyp:common
37 static_library("common") {
38   sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
39   defines = []
41   configs += [ "//build/config/compiler:wexit_time_destructors" ]
43   deps = [
44     ":version",
45     "//base:base",
46     "//base:i18n",
47     "//base:prefs",
48     "//base:base_static",
49     "//chrome:resources",
50     "//chrome:strings",
51     "//chrome/app/theme:theme_resources",
52     "//chrome/common:constants",
53     "//chrome/common/net",
54     "//chrome/common/safe_browsing:proto",
55     "//chrome/installer/util",
56     "//components/cloud_devices/common",
57     "//components/content_settings/core/common",
58     "//components/json_schema",
59     "//components/metrics",
60     "//components/policy:policy_component_common",
61     "//components/translate/core/common",
62     "//components/variations",
63     "//content/public/common",
64     "//crypto",
65     "//extensions:extensions_resources",
66     "//extensions/strings",
67     "//media/cast:net",
68     "//net",
69     "//skia",
70     "//third_party/icu",
71     "//third_party/libxml",
72     "//third_party/sqlite",
73     "//third_party/zlib:zip",
74     "//ui/resources:resources",
75     "//url",
76   ]
78   if (is_ios) {
79     sources += [
80       # Use this Mac file that was filtered out.
81       "chrome_version_info_mac.mm",
82     ]
83   } else {
84     # Non-iOS.
85     deps += [
86       "//chrome/common/extensions/api",
87       "//components/visitedlink/common",
88       "//components/autofill/content/common",
89       "//components/autofill/core/common",
90       "//components/password_manager/content/common",
91       "//components/password_manager/core/common",
92       "//components/signin/core/common",
93       "//components/translate/content/common",
94       "//extensions/common",
95       "//extensions/common/api",
96       "//ipc",
97       "//third_party/adobe/flash:flapper_version_h",
98       "//third_party/re2",
99       "//third_party/widevine/cdm:version_h",
100     ]
101   }
103   if (enable_extensions) {
104     sources += rebase_path(
105         gypi_values.chrome_common_extensions_sources,
106         ".", "//chrome")
107     deps += [
108       "//device/bluetooth",
109       "//device/usb",
110     ]
111   }
113   if (is_win || is_mac) {
114     sources += rebase_path(
115         gypi_values.chrome_common_win_mac_sources,
116         ".", "//chrome")
117     if (use_openssl) {
118       sources -= [
119         "extensions/api/networking_private/networking_private_crypto_nss.cc",
120       ]
121       # networking_private_crypto_openssl.cc depends on boringssl.
122       deps += [
123         "//third_party/boringssl",
124       ]
125     } else {
126       sources -= [
127         "extensions/api/networking_private/networking_private_crypto_openssl.cc",
128       ]
129     }
130     deps += [ "//breakpad:client" ]
131   }
132   if (is_mac) {
133     sources += rebase_path(
134         gypi_values.chrome_common_mac_sources,
135         ".", "//chrome")
136   }
138   if (enable_nacl) {
139     deps += [
140       #'<(DEPTH)/components/nacl.gyp:nacl_common',  TODO(GYP)
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   # TODO(brettw) this duplicates "//chrome/common:version" which applies to
237   # Windows.
238   import("//chrome/version.gni")
239   process_version("version") {
240     visibility = ":common"
241     source = "chrome_version_info_posix.h.version"
242     output = "$target_gen_dir/chrome_version_info_posix.h"
243   }
244 } else {
245   # Other platforms have a different way to do versioning.
246   group("version") {
247   }
250 # GN version: chrome/common_constants.gyp:common_constants
251 static_library("constants") {
252   sources = [
253     "chrome_constants.cc",
254     "chrome_constants.h",
255     "chrome_icon_resources_win.cc",
256     "chrome_icon_resources_win.h",
257     "chrome_paths.cc",
258     "chrome_paths.h",
259     "chrome_paths_android.cc",
260     "chrome_paths_internal.h",
261     "chrome_paths_linux.cc",
262     "chrome_paths_mac.mm",
263     "chrome_paths_win.cc",
264     "chrome_switches.cc",
265     "chrome_switches.h",
266     "env_vars.cc",
267     "env_vars.h",
268     "net/test_server_locations.cc",
269     "net/test_server_locations.h",
270     "pref_font_script_names-inl.h",
271     "pref_font_webkit_names.h",
272     "pref_names.cc",
273     "pref_names.h",
274     "widevine_cdm_constants.cc",
275     "widevine_cdm_constants.h",
276   ]
278   deps = [
279     "//base",
280     "//base/third_party/dynamic_annotations",
281     "//components/bookmarks/common",
282     "//third_party/widevine/cdm:version_h",
283   ]
285   if (enable_nacl) {
286     deps += [
287       #'../components/nacl.gyp:nacl_switches',  TODO(GYP)
288     ]
289   }