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")
8 gypi_values = exec_script("//build/gypi_to_gn.py",
9 [ rebase_path("../chrome_common.gypi") ],
11 [ "../chrome_common.gypi" ])
13 # GYP version: chrome/chrome_resources.gyp:chrome_resources
14 # (generate_common_resources action)
16 source = "common_resources.grd"
17 output_dir = "$root_gen_dir/chrome"
18 output_name = "common_resources"
20 "grit/common_resources.h",
21 "common_resources.pak",
25 # GYP version: chrome/chrome_resources.gyp:chrome_resources
26 # (generate_extensions_api_resources action)
27 if (enable_extensions) {
28 grit("extensions_api_resources") {
29 source = "extensions_api_resources.grd"
30 output_dir = "$root_gen_dir/chrome"
32 "grit/extensions_api_resources.h",
33 "extensions_api_resources.pak",
38 # GYP version: chrome/chrome_common.gyp:common
39 static_library("common") {
40 sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome")
44 "//build/config:precompiled_headers",
45 "//build/config/compiler:wexit_time_destructors",
49 "//chrome/common:constants",
50 "//chrome/common/net",
51 "//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 "//content/public/common",
77 "//extensions/common:common_constants",
81 "//third_party/zlib:zip",
82 "//ui/resources:resources",
88 # Use this Mac file that was filtered out.
89 "chrome_version_info_mac.mm",
92 "resource_usage_reporter_type_converters.cc",
93 "resource_usage_reporter_type_converters.h",
99 "//components/visitedlink/common",
100 "//components/autofill/content/common",
101 "//components/autofill/core/common",
102 "//components/password_manager/content/common",
103 "//components/password_manager/core/common",
104 "//components/signin/core/common",
105 "//components/translate/content/common",
108 "//third_party/widevine/cdm:version_h",
110 public_deps += [ "//third_party/mojo/src/mojo/public/cpp/bindings" ]
113 if (enable_extensions) {
114 sources += rebase_path(gypi_values.chrome_common_extensions_sources,
119 "//chrome/common/extensions/api",
120 "//extensions/common",
121 "//extensions/common/api",
122 "//extensions:extensions_resources",
123 "//extensions/strings",
128 rebase_path(gypi_values.chrome_common_extensions_chromeos_sources,
134 if (is_win || is_mac) {
136 rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
137 deps += [ "//breakpad:client" ]
139 if (is_win || is_mac || is_chromeos) {
141 sources += rebase_path(
142 gypi_values.chrome_common_networking_private_sources_openssl,
146 # networking_private_crypto_openssl.cc depends on boringssl.
147 deps += [ "//third_party/boringssl" ]
150 rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
157 rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
158 deps += [ ":app_mode_app_support" ]
162 deps += [ "//components/nacl:nacl_common" ]
166 if (enable_basic_printing || enable_print_preview) {
168 "//components/printing/common:printing_common",
171 if (enable_print_preview) {
172 # Full printing support.
173 sources += rebase_path(gypi_values.chrome_common_service_process_sources,
179 if (enable_service_discovery) {
181 "local_discovery/service_discovery_client.cc",
182 "local_discovery/service_discovery_client.h",
187 "local_discovery/service_discovery_client_impl.cc",
188 "local_discovery/service_discovery_client_impl.h",
195 "chrome_version_info_posix.cc",
196 "icon_with_badge_image_source.cc",
197 "media_galleries/metadata_types.h",
202 rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
206 sources -= [ "chrome_version_info_posix.cc" ]
211 "//components/dom_distiller/core", # Needed by chrome_content_client.cc.
217 sources += [ "local_discovery/local_discovery_messages.h" ]
221 sources -= [ "chrome_version_info_posix.cc" ]
223 "//third_party/mach_override",
224 "//third_party/google_toolbox_for_mac",
228 if (enable_plugins) {
235 deps += [ "//third_party/adobe/flash:flapper_version_h" ]
237 if (enable_plugins && enable_extensions) {
239 "pepper_permission_util.cc",
240 "pepper_permission_util.h",
243 if (!enable_webrtc) {
244 sources -= [ "media/webrtc_logging_messages.h" ]
246 if (enable_configuration_policy) {
247 deps += [ "//components/policy" ]
250 if (safe_browsing_mode == 1) {
251 sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
257 # This target allows other targets to depend on result_codes.h which is a
258 # header-only dependency, without bringing in all of content.
259 source_set("result_codes") {
261 "chrome_result_codes.h",
265 import("//chrome/version.gni")
266 process_version("version") {
267 visibility = [ ":common" ]
268 template_file = "chrome_version_info_values.h.version"
269 output = "$target_gen_dir/chrome_version_info_values.h"
272 process_version("make_chrome_version") {
273 template_file = "chrome_version.cc.version"
274 output = "$target_gen_dir/chrome_version.cc"
277 # GN version: chrome/common_constants.gyp:common_constants
278 static_library("constants") {
280 "chrome_constants.cc",
281 "chrome_constants.h",
282 "chrome_icon_resources_win.cc",
283 "chrome_icon_resources_win.h",
286 "chrome_paths_android.cc",
287 "chrome_paths_internal.h",
288 "chrome_paths_linux.cc",
289 "chrome_paths_mac.mm",
290 "chrome_paths_win.cc",
291 "chrome_switches.cc",
295 "net/test_server_locations.cc",
296 "net/test_server_locations.h",
297 "pref_font_script_names-inl.h",
298 "pref_font_webkit_names.h",
301 "widevine_cdm_constants.cc",
302 "widevine_cdm_constants.h",
306 ":make_chrome_version",
308 "//base/third_party/dynamic_annotations",
309 "//components/bookmarks/common",
310 "//third_party/widevine/cdm:version_h",
314 deps += [ "//components/nacl:nacl_switches" ]
318 source_set("test_support") {
320 visibility = [ "//chrome/test:test_support" ]
330 if (is_win || is_mac) {
332 "media_galleries/picasa_test_util.cc",
333 "media_galleries/picasa_test_util.h",
334 "media_galleries/pmp_test_util.cc",
335 "media_galleries/pmp_test_util.h",
339 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
341 if (enable_extensions) {
343 "extensions/extension_test_util.cc",
344 "extensions/extension_test_util.h",
349 # GN version: chrome/chrome.gyp:app_mode_app_support
350 static_library("app_mode_app_support") {
352 "mac/app_mode_chrome_locator.h",
353 "mac/app_mode_chrome_locator.mm",
354 "mac/app_mode_common.h",
355 "mac/app_mode_common.mm",
364 mojom("mojo_bindings") {
366 "resource_usage_reporter.mojom",