Remove the old signature of NotificationManager::closePersistent().
[chromium-blink-merge.git] / chrome / common / BUILD.gn
blobeaf976791149e66f5ad0f4144dcce21d55adfd83
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/favicon_base",
60     "//components/json_schema",
61     "//components/metrics",
62     "//components/policy:policy_component_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 += [ "//components/nacl:nacl_common" ]
142   }
144   # Printing.
145   if (enable_basic_printing || enable_print_preview) {
146     deps += [
147       "//components/printing/common:printing_common",
148       "//printing",
149     ]
150     if (enable_print_preview) {
151       # Full printing support.
152       sources += rebase_path(gypi_values.chrome_common_service_process_sources,
153                              ".",
154                              "//chrome")
155     }
156   }
158   if (enable_service_discovery) {
159     sources += [
160       "local_discovery/service_discovery_client.cc",
161       "local_discovery/service_discovery_client.h",
162     ]
163   }
164   if (enable_mdns) {
165     sources += [
166       "local_discovery/service_discovery_client_impl.cc",
167       "local_discovery/service_discovery_client_impl.h",
168     ]
169   }
171   if (is_android) {
172     sources -= [
173       "badge_util.cc",
174       "chrome_version_info_posix.cc",
175       "icon_with_badge_image_source.cc",
176       "media_galleries/metadata_types.h",
177       "spellcheck_common.cc",
178     ]
179   } else {
180     # Non-Android.
181     sources +=
182         rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
183   }
185   if (is_chromeos) {
186     sources -= [ "chrome_version_info_posix.cc" ]
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_mac) {
198     sources -= [ "chrome_version_info_posix.cc" ]
199     deps += [
200       "//third_party/mach_override",
201       "//third_party/google_toolbox_for_mac",
202     ]
203   }
205   if (enable_plugins) {
206     sources += [
207       "pepper_flash.cc",
208       "pepper_flash.h",
209       "ppapi_utils.cc",
210       "ppapi_utils.h",
211     ]
212     deps += [ "//third_party/adobe/flash:flapper_version_h" ]
213   }
214   if (enable_plugins && enable_extensions) {
215     sources += [
216       "pepper_permission_util.cc",
217       "pepper_permission_util.h",
218     ]
219   }
220   if (!enable_webrtc) {
221     sources -= [ "media/webrtc_logging_messages.h" ]
222   }
223   if (enable_configuration_policy) {
224     deps += [ "//components/policy" ]
225   }
227   if (safe_browsing_mode == 1) {
228     defines += [ "FULL_SAFE_BROWSING" ]
229     sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
230                            ".",
231                            "//chrome")
232   }
233   if (safe_browsing_mode == 2) {
234     defines += [ "MOBILE_SAFE_BROWSING" ]
235   }
238 import("//chrome/version.gni")
239 process_version("version") {
240   visibility = [ ":common" ]
241   template_file = "chrome_version_info_values.h.version"
242   output = "$target_gen_dir/chrome_version_info_values.h"
245 process_version("make_chrome_version") {
246   template_file = "chrome_version.cc.version"
247   output = "$target_gen_dir/chrome_version.cc"
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   ]
277   sources += get_target_outputs(":make_chrome_version")
279   deps = [
280     ":make_chrome_version",
281     "//base",
282     "//base/third_party/dynamic_annotations",
283     "//components/bookmarks/common",
284     "//third_party/widevine/cdm:version_h",
285   ]
287   if (enable_nacl) {
288     deps += [ "//components/nacl:nacl_switches" ]
289   }
292 source_set("test_support") {
293   testonly = true
294   visibility = [ "//chrome/test:test_support" ]
296   sources = []
298   deps = [
299     ":common",
300     "//base",
301     "//testing/gtest",
302   ]
304   if (is_win || is_mac) {
305     sources += [
306       "media_galleries/picasa_test_util.cc",
307       "media_galleries/picasa_test_util.h",
308       "media_galleries/pmp_test_util.cc",
309       "media_galleries/pmp_test_util.h",
310     ]
311   }
313   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
315   if (enable_extensions) {
316     sources += [
317       "extensions/extension_test_util.cc",
318       "extensions/extension_test_util.h",
319     ]
320   }