Clean up is_swapped_out references in RenderFrameImpl.
[chromium-blink-merge.git] / chrome / common / BUILD.gn
blob8167270fe79fd1da71c8a042a161e38e42a22301
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 if (enable_extensions) {
29 grit("extensions_api_resources") {
30   source = "extensions_api_resources.grd"
31   output_dir = "$root_gen_dir/chrome"
32   outputs = [
33     "grit/extensions_api_resources.h",
34     "extensions_api_resources.pak",
35   ]
40 # GYP version: chrome/chrome_common.gyp:common
41 static_library("common") {
42   sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
43   defines = []
45   configs += [ "//build/config/compiler:wexit_time_destructors" ]
47   deps = [
48     ":version",
49     "//base:base",
50     "//base:i18n",
51     "//base:prefs",
52     "//base:base_static",
53     "//chrome:resources",
54     "//chrome:strings",
55     "//chrome/app/theme:theme_resources",
56     "//chrome/common:constants",
57     "//chrome/common/net",
58     "//chrome/common/safe_browsing:proto",
59     "//chrome/installer/util",
60     "//components/cloud_devices/common",
61     "//components/content_settings/core/common",
62     "//components/json_schema",
63     "//components/metrics",
64     "//components/policy:policy_component_common",
65     "//components/translate/core/common",
66     "//components/variations",
67     "//content/public/common",
68     "//crypto",
69     "//extensions/common:common_constants",
70     "//media/cast:net",
71     "//net",
72     "//skia",
73     "//third_party/icu",
74     "//third_party/libxml",
75     "//third_party/sqlite",
76     "//third_party/zlib:zip",
77     "//ui/resources:resources",
78     "//url",
79   ]
81   if (is_ios) {
82     sources += [
83       # Use this Mac file that was filtered out.
84       "chrome_version_info_mac.mm",
85     ]
86   } else {
87     # Non-iOS.
88     deps += [
89       "//components/visitedlink/common",
90       "//components/autofill/content/common",
91       "//components/autofill/core/common",
92       "//components/password_manager/content/common",
93       "//components/password_manager/core/common",
94       "//components/signin/core/common",
95       "//components/translate/content/common",
96       "//ipc",
97       "//third_party/re2",
98       "//third_party/widevine/cdm:version_h",
99     ]
100   }
102   if (enable_extensions) {
103     sources += rebase_path(
104         gypi_values.chrome_common_extensions_sources,
105         ".", "//chrome")
106     deps += [
107       "//device/usb",
108       "//chrome/common/extensions/api",
109       "//extensions/common",
110       "//extensions/common/api",
111       "//extensions:extensions_resources",
112       "//extensions/strings",
113     ]
114   }
116   if (is_win || is_mac) {
117     sources += rebase_path(
118         gypi_values.chrome_common_win_mac_sources,
119         ".", "//chrome")
120     if (use_openssl) {
121       sources -= [
122         "extensions/api/networking_private/networking_private_crypto_nss.cc",
123       ]
124       # networking_private_crypto_openssl.cc depends on boringssl.
125       deps += [
126         "//third_party/boringssl",
127       ]
128     } else {
129       sources -= [
130         "extensions/api/networking_private/networking_private_crypto_openssl.cc",
131       ]
132     }
133     deps += [ "//breakpad:client" ]
134   }
135   if (is_mac) {
136     sources += rebase_path(
137         gypi_values.chrome_common_mac_sources,
138         ".", "//chrome")
139   }
141   if (enable_nacl) {
142     deps += [
143       #'<(DEPTH)/components/nacl.gyp:nacl_common',  TODO(GYP)
144     ]
145   }
147   # Printing.
148   if (!enable_basic_printing && !enable_print_preview) {
149     sources -= [
150       "print_messages.cc",
151       "print_messages.h",
152     ]
153   } else {
154     deps += [ "//printing" ]
155     if (enable_print_preview) {
156       # Full printing support.
157       sources += rebase_path(
158           gypi_values.chrome_common_service_process_sources,
159           ".", "//chrome")
160     }
161   }
163   if (enable_service_discovery) {
164     sources += [
165       "local_discovery/service_discovery_client.cc",
166       "local_discovery/service_discovery_client.h",
167     ]
168   }
169   if (enable_mdns) {
170     sources += [
171       "local_discovery/service_discovery_client_impl.cc",
172       "local_discovery/service_discovery_client_impl.h",
173     ]
174   }
176   if (is_android) {
177     sources -= [
178       "badge_util.cc",
179       "chrome_version_info_posix.cc",
180       "icon_with_badge_image_source.cc",
181       "media_galleries/metadata_types.h",
182       "spellcheck_common.cc",
183     ]
184   } else {
185     # Non-Android.
186     sources += rebase_path(
187         gypi_values.chrome_common_importer_sources,
188         ".", "//chrome")
189   }
191   if (is_chromeos) {
192     sources -= [ "chrome_version_info_posix.cc" ]
193   }
195   if (is_win) {
196     deps += [ "//third_party/wtl" ]
197   }
199   if (enable_mdns) {
200     sources += [ "local_discovery/local_discovery_messages.h" ]
201   }
203   if (is_mac) {
204     sources -= [
205       "chrome_version_info_posix.cc",
206     ]
207     deps += [
208       "//third_party/mach_override",
209       "//third_party/google_toolbox_for_mac",
210     ]
211   }
213   if (enable_remoting) {
214     deps += [ "//remoting/client/plugin" ]
215   }
216   if (enable_plugins) {
217     sources += [
218       "pepper_flash.cc",
219       "pepper_flash.h",
220       "pepper_permission_util.cc",
221       "pepper_permission_util.h",
222     ]
223     deps += [
224       "//third_party/adobe/flash:flapper_version_h",
225     ]
226   }
227   if (!enable_webrtc) {
228     sources -= [ "media/webrtc_logging_messages.h" ]
229   }
230   if (enable_configuration_policy) {
231     deps += [ "//components/policy" ]
232   }
234   if (safe_browsing_mode == 1) {
235     defines += [ "FULL_SAFE_BROWSING" ]
236     sources += rebase_path(
237         gypi_values.chrome_common_full_safe_browsing_sources,
238         ".", "//chrome")
239   }
240   if (safe_browsing_mode == 2) {
241     defines += [ "MOBILE_SAFE_BROWSING" ]
242   }
245 import("//chrome/version.gni")
246 process_version("version") {
247   visibility = [ ":common" ]
248   source = "chrome_version_info_values.h.version"
249   output = "$target_gen_dir/chrome_version_info_values.h"
252 # GN version: chrome/common_constants.gyp:common_constants
253 static_library("constants") {
254   sources = [
255     "chrome_constants.cc",
256     "chrome_constants.h",
257     "chrome_icon_resources_win.cc",
258     "chrome_icon_resources_win.h",
259     "chrome_paths.cc",
260     "chrome_paths.h",
261     "chrome_paths_android.cc",
262     "chrome_paths_internal.h",
263     "chrome_paths_linux.cc",
264     "chrome_paths_mac.mm",
265     "chrome_paths_win.cc",
266     "chrome_switches.cc",
267     "chrome_switches.h",
268     "env_vars.cc",
269     "env_vars.h",
270     "net/test_server_locations.cc",
271     "net/test_server_locations.h",
272     "pref_font_script_names-inl.h",
273     "pref_font_webkit_names.h",
274     "pref_names.cc",
275     "pref_names.h",
276     "widevine_cdm_constants.cc",
277     "widevine_cdm_constants.h",
278   ]
280   deps = [
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 += [
289       #'../components/nacl.gyp:nacl_switches',  TODO(GYP)
290     ]
291   }
294 source_set("test_support") {
295   testonly = true
296   visibility = [ "//chrome/test:test_support" ]
298   sources = [
299   ]
301   deps = [
302     ":common",
303     "//base",
304     "//testing/gtest",
305   ]
307   if (is_win || is_mac) {
308     sources += [
309       "media_galleries/picasa_test_util.cc",
310       "media_galleries/picasa_test_util.h",
311       "media_galleries/pmp_test_util.cc",
312       "media_galleries/pmp_test_util.h",
313     ]
314   }
316   if (enable_extensions) {
317     sources += [
318       "extensions/extension_test_util.cc",
319       "extensions/extension_test_util.h",
320     ]
321   }