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/safe_browsing:proto",
60 "//chrome/app/theme:theme_resources",
61 "//chrome/common/variations:fieldtrial_testing_config",
62 "//chrome/installer/util",
63 "//components/cloud_devices/common",
64 "//components/component_updater",
65 "//components/content_settings/core/common",
66 "//components/crash_keys",
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/url_formatter",
75 "//components/variations",
76 "//components/version_info",
77 "//content/public/common",
79 "//extensions/common:common_constants",
83 "//third_party/zlib:zip",
84 "//ui/resources:resources",
90 # Use this Mac file that was filtered out.
91 "channel_info_mac.mm",
94 "resource_usage_reporter_type_converters.cc",
95 "resource_usage_reporter_type_converters.h",
101 "//components/visitedlink/common",
102 "//components/autofill/content/common",
103 "//components/autofill/core/common",
104 "//components/password_manager/content/common",
105 "//components/password_manager/core/common",
106 "//components/signin/core/common",
107 "//components/translate/content/common",
110 "//third_party/widevine/cdm:version_h",
113 "//chrome/common/net",
114 "//third_party/mojo/src/mojo/public/cpp/bindings",
118 if (enable_extensions) {
119 sources += rebase_path(gypi_values.chrome_common_extensions_sources,
124 "//chrome/common/extensions/api",
125 "//extensions/common",
126 "//extensions/common/api",
127 "//extensions:extensions_resources",
128 "//extensions/strings",
133 rebase_path(gypi_values.chrome_common_extensions_chromeos_sources,
139 if (is_win || is_mac) {
141 rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
142 deps += [ "//breakpad:client" ]
144 if (is_win || is_mac || is_chromeos) {
146 sources += rebase_path(
147 gypi_values.chrome_common_networking_private_sources_openssl,
151 # networking_private_crypto_openssl.cc depends on boringssl.
152 deps += [ "//third_party/boringssl" ]
155 rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
162 rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
163 deps += [ ":app_mode_app_support" ]
167 deps += [ "//components/nacl:nacl_common" ]
171 if (enable_basic_printing || enable_print_preview) {
173 "//components/printing/common",
176 if (enable_print_preview) {
177 # Full printing support.
178 sources += rebase_path(gypi_values.chrome_common_service_process_sources,
184 if (enable_service_discovery) {
186 "local_discovery/service_discovery_client.cc",
187 "local_discovery/service_discovery_client.h",
192 "local_discovery/service_discovery_client_impl.cc",
193 "local_discovery/service_discovery_client_impl.h",
200 "channel_info_posix.cc",
201 "icon_with_badge_image_source.cc",
202 "media_galleries/metadata_types.h",
207 rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
211 sources -= [ "channel_info_posix.cc" ]
216 "//components/dom_distiller/core", # Needed by chrome_content_client.cc.
222 sources += [ "local_discovery/local_discovery_messages.h" ]
226 sources -= [ "channel_info_posix.cc" ]
228 "//third_party/mach_override",
229 "//third_party/google_toolbox_for_mac",
233 if (enable_plugins) {
240 deps += [ "//third_party/adobe/flash:flapper_version_h" ]
242 if (enable_plugins && enable_extensions) {
244 "pepper_permission_util.cc",
245 "pepper_permission_util.h",
248 if (!enable_webrtc) {
249 sources -= [ "media/webrtc_logging_messages.h" ]
251 if (enable_configuration_policy) {
252 deps += [ "//components/policy" ]
255 if (safe_browsing_mode == 1) {
256 sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
262 # This target allows other targets to depend on result_codes.h which is a
263 # header-only dependency, without bringing in all of content.
264 source_set("result_codes") {
266 "chrome_result_codes.h",
270 process_version("make_chrome_version") {
271 template_file = "chrome_version.cc.version"
272 output = "$target_gen_dir/chrome_version.cc"
275 # GN version: chrome/common_constants.gyp:common_constants
276 static_library("constants") {
278 "chrome_constants.cc",
279 "chrome_constants.h",
280 "chrome_icon_resources_win.cc",
281 "chrome_icon_resources_win.h",
284 "chrome_paths_android.cc",
285 "chrome_paths_internal.h",
286 "chrome_paths_linux.cc",
287 "chrome_paths_mac.mm",
288 "chrome_paths_win.cc",
289 "chrome_switches.cc",
293 "pref_font_script_names-inl.h",
294 "pref_font_webkit_names.h",
297 "widevine_cdm_constants.cc",
298 "widevine_cdm_constants.h",
302 ":make_chrome_version",
304 "//base/third_party/dynamic_annotations",
305 "//components/bookmarks/common",
306 "//third_party/widevine/cdm:version_h",
310 deps += [ "//components/nacl:nacl_switches" ]
314 source_set("test_support") {
316 visibility = [ "//chrome/test:test_support" ]
326 if (is_win || is_mac) {
328 "media_galleries/picasa_test_util.cc",
329 "media_galleries/picasa_test_util.h",
330 "media_galleries/pmp_test_util.cc",
331 "media_galleries/pmp_test_util.h",
335 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
337 if (enable_extensions) {
339 "extensions/extension_test_util.cc",
340 "extensions/extension_test_util.h",
345 # GN version: chrome/chrome.gyp:app_mode_app_support
346 static_library("app_mode_app_support") {
348 "mac/app_mode_chrome_locator.h",
349 "mac/app_mode_chrome_locator.mm",
350 "mac/app_mode_common.h",
351 "mac/app_mode_common.mm",
360 mojom("mojo_bindings") {
362 "resource_usage_reporter.mojom",