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")
6 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
7 import("//chrome/version.gni")
9 gypi_values = exec_script("//build/gypi_to_gn.py",
10 [ rebase_path("../chrome_common.gypi") ],
12 [ "../chrome_common.gypi" ])
14 # GYP version: chrome/chrome_resources.gyp:chrome_resources
15 # (generate_common_resources action)
17 source = "common_resources.grd"
18 output_dir = "$root_gen_dir/chrome"
19 output_name = "common_resources"
21 "grit/common_resources.h",
22 "common_resources.pak",
26 # GYP version: chrome/chrome_resources.gyp:chrome_resources
27 # (generate_extensions_api_resources action)
28 if (enable_extensions) {
29 grit("extensions_api_resources") {
30 source = "extensions_api_resources.grd"
31 output_dir = "$root_gen_dir/chrome"
33 "grit/extensions_api_resources.h",
34 "extensions_api_resources.pak",
39 # GYP version: chrome/chrome_common.gyp:common
40 static_library("common") {
41 sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
45 "//build/config:precompiled_headers",
46 "//build/config/compiler:wexit_time_destructors",
50 "//chrome/common:constants",
51 "//chrome/common/net",
52 "//chrome/common/safe_browsing:proto",
61 "//chrome/app/theme:theme_resources",
62 "//chrome/common/variations:fieldtrial_testing_config",
63 "//chrome/installer/util",
64 "//components/cloud_devices/common",
65 "//components/component_updater",
66 "//components/content_settings/core/common",
67 "//components/favicon_base",
68 "//components/gcm_driver/common",
69 "//components/json_schema",
70 "//components/metrics",
71 "//components/omnibox/common",
72 "//components/policy:policy_component_common",
73 "//components/translate/core/common",
74 "//components/variations",
75 "//components/version_info",
76 "//content/public/common",
78 "//extensions/common:common_constants",
82 "//third_party/zlib:zip",
83 "//ui/resources:resources",
89 # Use this Mac file that was filtered out.
90 "channel_info_mac.mm",
93 "resource_usage_reporter_type_converters.cc",
94 "resource_usage_reporter_type_converters.h",
100 "//components/visitedlink/common",
101 "//components/autofill/content/common",
102 "//components/autofill/core/common",
103 "//components/password_manager/content/common",
104 "//components/password_manager/core/common",
105 "//components/signin/core/common",
106 "//components/translate/content/common",
109 "//third_party/widevine/cdm:version_h",
111 public_deps += [ "//third_party/mojo/src/mojo/public/cpp/bindings" ]
114 if (enable_extensions) {
115 sources += rebase_path(gypi_values.chrome_common_extensions_sources,
120 "//chrome/common/extensions/api",
121 "//extensions/common",
122 "//extensions/common/api",
123 "//extensions:extensions_resources",
124 "//extensions/strings",
129 rebase_path(gypi_values.chrome_common_extensions_chromeos_sources,
135 if (is_win || is_mac) {
137 rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
138 deps += [ "//breakpad:client" ]
140 if (is_win || is_mac || is_chromeos) {
142 sources += rebase_path(
143 gypi_values.chrome_common_networking_private_sources_openssl,
147 # networking_private_crypto_openssl.cc depends on boringssl.
148 deps += [ "//third_party/boringssl" ]
151 rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
158 rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
159 deps += [ ":app_mode_app_support" ]
163 deps += [ "//components/nacl:nacl_common" ]
167 if (enable_basic_printing || enable_print_preview) {
169 "//components/printing/common:printing_common",
172 if (enable_print_preview) {
173 # Full printing support.
174 sources += rebase_path(gypi_values.chrome_common_service_process_sources,
180 if (enable_service_discovery) {
182 "local_discovery/service_discovery_client.cc",
183 "local_discovery/service_discovery_client.h",
188 "local_discovery/service_discovery_client_impl.cc",
189 "local_discovery/service_discovery_client_impl.h",
196 "channel_info_posix.cc",
197 "icon_with_badge_image_source.cc",
198 "media_galleries/metadata_types.h",
203 rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
207 sources -= [ "channel_info_posix.cc" ]
212 "//components/dom_distiller/core", # Needed by chrome_content_client.cc.
218 sources += [ "local_discovery/local_discovery_messages.h" ]
222 sources -= [ "channel_info_posix.cc" ]
224 "//third_party/mach_override",
225 "//third_party/google_toolbox_for_mac",
229 if (enable_plugins) {
236 deps += [ "//third_party/adobe/flash:flapper_version_h" ]
238 if (enable_plugins && enable_extensions) {
240 "pepper_permission_util.cc",
241 "pepper_permission_util.h",
244 if (!enable_webrtc) {
245 sources -= [ "media/webrtc_logging_messages.h" ]
247 if (enable_configuration_policy) {
248 deps += [ "//components/policy" ]
251 if (safe_browsing_mode == 1) {
252 sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
258 # This target allows other targets to depend on result_codes.h which is a
259 # header-only dependency, without bringing in all of content.
260 source_set("result_codes") {
262 "chrome_result_codes.h",
266 process_version("make_chrome_version") {
267 template_file = "chrome_version.cc.version"
268 output = "$target_gen_dir/chrome_version.cc"
271 # GN version: chrome/common_constants.gyp:common_constants
272 static_library("constants") {
274 "chrome_constants.cc",
275 "chrome_constants.h",
276 "chrome_icon_resources_win.cc",
277 "chrome_icon_resources_win.h",
280 "chrome_paths_android.cc",
281 "chrome_paths_internal.h",
282 "chrome_paths_linux.cc",
283 "chrome_paths_mac.mm",
284 "chrome_paths_win.cc",
285 "chrome_switches.cc",
289 "net/test_server_locations.cc",
290 "net/test_server_locations.h",
291 "pref_font_script_names-inl.h",
292 "pref_font_webkit_names.h",
295 "widevine_cdm_constants.cc",
296 "widevine_cdm_constants.h",
300 ":make_chrome_version",
302 "//base/third_party/dynamic_annotations",
303 "//components/bookmarks/common",
304 "//third_party/widevine/cdm:version_h",
308 deps += [ "//components/nacl:nacl_switches" ]
312 source_set("test_support") {
314 visibility = [ "//chrome/test:test_support" ]
324 if (is_win || is_mac) {
326 "media_galleries/picasa_test_util.cc",
327 "media_galleries/picasa_test_util.h",
328 "media_galleries/pmp_test_util.cc",
329 "media_galleries/pmp_test_util.h",
333 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
335 if (enable_extensions) {
337 "extensions/extension_test_util.cc",
338 "extensions/extension_test_util.h",
343 # GN version: chrome/chrome.gyp:app_mode_app_support
344 static_library("app_mode_app_support") {
346 "mac/app_mode_chrome_locator.h",
347 "mac/app_mode_chrome_locator.mm",
348 "mac/app_mode_common.h",
349 "mac/app_mode_common.mm",
358 mojom("mojo_bindings") {
360 "resource_usage_reporter.mojom",