[Storage] Blob Storage Refactoring pt 1:
[chromium-blink-merge.git] / chrome / common / BUILD.gn
blobd6a03e0fc327ee420e593cd2d16d697999e63115
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("//build/gypi_to_gn.py",
8                           [ rebase_path("../chrome_common.gypi") ],
9                           "scope",
10                           [ "../chrome_common.gypi" ])
12 # GYP version: chrome/chrome_resources.gyp:chrome_resources
13 #              (generate_common_resources action)
14 grit("resources") {
15   source = "common_resources.grd"
16   output_dir = "$root_gen_dir/chrome"
17   output_name = "common_resources"
18   outputs = [
19     "grit/common_resources.h",
20     "common_resources.pak",
21   ]
24 # GYP version: chrome/chrome_resources.gyp:chrome_resources
25 #              (generate_extensions_api_resources action)
26 if (enable_extensions) {
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     ]
34   }
37 # GYP version: chrome/chrome_common.gyp:common
38 static_library("common") {
39   sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
40   defines = []
42   configs += [ "//build/config/compiler:wexit_time_destructors" ]
44   deps = [
45     ":version",
46     "//base:base",
47     "//base:i18n",
48     "//base:prefs",
49     "//base:base_static",
50     "//chrome:resources",
51     "//chrome:strings",
52     "//chrome/app/theme:theme_resources",
53     "//chrome/common:constants",
54     "//chrome/common/net",
55     "//chrome/common/safe_browsing:proto",
56     "//chrome/installer/util",
57     "//components/cloud_devices/common",
58     "//components/content_settings/core/common",
59     "//components/json_schema",
60     "//components/metrics",
61     "//components/policy:policy_component_common",
62     "//components/printing/common:printing_common",
63     "//components/translate/core/common",
64     "//components/variations",
65     "//content/public/common",
66     "//crypto",
67     "//extensions/common:common_constants",
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       "//components/visitedlink/common",
87       "//components/autofill/content/common",
88       "//components/autofill/core/common",
89       "//components/password_manager/content/common",
90       "//components/password_manager/core/common",
91       "//components/signin/core/common",
92       "//components/translate/content/common",
93       "//ipc",
94       "//third_party/re2",
95       "//third_party/widevine/cdm:version_h",
96     ]
97   }
99   if (enable_extensions) {
100     sources += rebase_path(gypi_values.chrome_common_extensions_sources,
101                            ".",
102                            "//chrome")
103     deps += [
104       "//device/usb",
105       "//chrome/common/extensions/api",
106       "//extensions/common",
107       "//extensions/common/api",
108       "//extensions:extensions_resources",
109       "//extensions/strings",
110       "//media/cast:net",
111     ]
112   }
114   if (is_win || is_mac) {
115     sources +=
116         rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
117     deps += [ "//breakpad:client" ]
118   }
119   if (is_win || is_mac || is_chromeos) {
120     if (use_openssl) {
121       sources += rebase_path(
122               gypi_values.chrome_common_networking_private_sources_openssl,
123               ".",
124               "//chrome")
126       # networking_private_crypto_openssl.cc depends on boringssl.
127       deps += [ "//third_party/boringssl" ]
128     } else {
129       sources +=
130           rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
131                       ".",
132                       "//chrome")
133     }
134   }
135   if (is_mac) {
136     sources +=
137         rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
138   }
140   if (enable_nacl) {
141     deps += [
142       #'<(DEPTH)/components/nacl.gyp:nacl_common',  TODO(GYP)
143     ]
144   }
146   # Printing.
147   if (!enable_basic_printing && !enable_print_preview) {
148     sources -= [
149       "print_messages.cc",
150       "print_messages.h",
151     ]
152   } else {
153     deps += [ "//printing" ]
154     if (enable_print_preview) {
155       # Full printing support.
156       sources += rebase_path(gypi_values.chrome_common_service_process_sources,
157                              ".",
158                              "//chrome")
159     }
160   }
162   if (enable_service_discovery) {
163     sources += [
164       "local_discovery/service_discovery_client.cc",
165       "local_discovery/service_discovery_client.h",
166     ]
167   }
168   if (enable_mdns) {
169     sources += [
170       "local_discovery/service_discovery_client_impl.cc",
171       "local_discovery/service_discovery_client_impl.h",
172     ]
173   }
175   if (is_android) {
176     sources -= [
177       "badge_util.cc",
178       "chrome_version_info_posix.cc",
179       "icon_with_badge_image_source.cc",
180       "media_galleries/metadata_types.h",
181       "spellcheck_common.cc",
182     ]
183   } else {
184     # Non-Android.
185     sources +=
186         rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
187   }
189   if (is_chromeos) {
190     sources -= [ "chrome_version_info_posix.cc" ]
191   }
193   if (is_win) {
194     deps += [ "//third_party/wtl" ]
195   }
197   if (enable_mdns) {
198     sources += [ "local_discovery/local_discovery_messages.h" ]
199   }
201   if (is_mac) {
202     sources -= [ "chrome_version_info_posix.cc" ]
203     deps += [
204       "//third_party/mach_override",
205       "//third_party/google_toolbox_for_mac",
206     ]
207   }
209   if (enable_plugins) {
210     sources += [
211       "pepper_flash.cc",
212       "pepper_flash.h",
213       "pepper_permission_util.cc",
214       "pepper_permission_util.h",
215     ]
216     deps += [ "//third_party/adobe/flash:flapper_version_h" ]
217   }
218   if (!enable_webrtc) {
219     sources -= [ "media/webrtc_logging_messages.h" ]
220   }
221   if (enable_configuration_policy) {
222     deps += [ "//components/policy" ]
223   }
225   if (safe_browsing_mode == 1) {
226     defines += [ "FULL_SAFE_BROWSING" ]
227     sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
228                            ".",
229                            "//chrome")
230   }
231   if (safe_browsing_mode == 2) {
232     defines += [ "MOBILE_SAFE_BROWSING" ]
233   }
236 import("//chrome/version.gni")
237 process_version("version") {
238   visibility = [ ":common" ]
239   source = "chrome_version_info_values.h.version"
240   output = "$target_gen_dir/chrome_version_info_values.h"
243 # GN version: chrome/common_constants.gyp:common_constants
244 static_library("constants") {
245   sources = [
246     "chrome_constants.cc",
247     "chrome_constants.h",
248     "chrome_icon_resources_win.cc",
249     "chrome_icon_resources_win.h",
250     "chrome_paths.cc",
251     "chrome_paths.h",
252     "chrome_paths_android.cc",
253     "chrome_paths_internal.h",
254     "chrome_paths_linux.cc",
255     "chrome_paths_mac.mm",
256     "chrome_paths_win.cc",
257     "chrome_switches.cc",
258     "chrome_switches.h",
259     "env_vars.cc",
260     "env_vars.h",
261     "net/test_server_locations.cc",
262     "net/test_server_locations.h",
263     "pref_font_script_names-inl.h",
264     "pref_font_webkit_names.h",
265     "pref_names.cc",
266     "pref_names.h",
267     "widevine_cdm_constants.cc",
268     "widevine_cdm_constants.h",
269   ]
271   deps = [
272     "//base",
273     "//base/third_party/dynamic_annotations",
274     "//components/bookmarks/common",
275     "//third_party/widevine/cdm:version_h",
276   ]
278   if (enable_nacl) {
279     deps += [
280       #'../components/nacl.gyp:nacl_switches',  TODO(GYP)
281     ]
282   }
285 source_set("test_support") {
286   testonly = true
287   visibility = [ "//chrome/test:test_support" ]
289   sources = []
291   deps = [
292     ":common",
293     "//base",
294     "//testing/gtest",
295   ]
297   if (is_win || is_mac) {
298     sources += [
299       "media_galleries/picasa_test_util.cc",
300       "media_galleries/picasa_test_util.h",
301       "media_galleries/pmp_test_util.cc",
302       "media_galleries/pmp_test_util.h",
303     ]
304   }
306   if (enable_extensions) {
307     sources += [
308       "extensions/extension_test_util.cc",
309       "extensions/extension_test_util.h",
310     ]
311   }