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/strings",
74 "//components/translate/core/common",
75 "//components/url_formatter",
76 "//components/variations",
77 "//components/version_info",
78 "//content/public/common",
80 "//extensions/common:common_constants",
84 "//third_party/zlib:zip",
85 "//ui/resources:resources",
91 # Use this Mac file that was filtered out.
92 "channel_info_mac.mm",
95 "resource_usage_reporter_type_converters.cc",
96 "resource_usage_reporter_type_converters.h",
102 "//components/visitedlink/common",
103 "//components/autofill/content/common",
104 "//components/autofill/core/common",
105 "//components/password_manager/content/common",
106 "//components/password_manager/core/common",
107 "//components/signin/core/common",
108 "//components/translate/content/common",
111 "//third_party/widevine/cdm:version_h",
114 "//chrome/common/net",
115 "//third_party/mojo/src/mojo/public/cpp/bindings",
119 if (enable_extensions) {
120 sources += rebase_path(gypi_values.chrome_common_extensions_sources,
125 "//chrome/common/extensions/api",
126 "//extensions/common",
127 "//extensions/common/api",
128 "//extensions:extensions_resources",
129 "//extensions/strings",
134 rebase_path(gypi_values.chrome_common_extensions_chromeos_sources,
140 if (is_win || is_mac) {
142 rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
143 deps += [ "//breakpad:client" ]
145 if (is_win || is_mac || is_chromeos) {
147 sources += rebase_path(
148 gypi_values.chrome_common_networking_private_sources_openssl,
152 # networking_private_crypto_openssl.cc depends on boringssl.
153 deps += [ "//third_party/boringssl" ]
156 rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
163 rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
164 deps += [ ":app_mode_app_support" ]
168 deps += [ "//components/nacl:nacl_common" ]
172 if (enable_basic_printing || enable_print_preview) {
174 "//components/printing/common",
177 if (enable_print_preview) {
178 # Full printing support.
179 sources += rebase_path(gypi_values.chrome_common_service_process_sources,
185 if (enable_service_discovery) {
187 "local_discovery/service_discovery_client.cc",
188 "local_discovery/service_discovery_client.h",
193 "local_discovery/service_discovery_client_impl.cc",
194 "local_discovery/service_discovery_client_impl.h",
201 "channel_info_posix.cc",
202 "icon_with_badge_image_source.cc",
203 "media_galleries/metadata_types.h",
208 rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
212 sources -= [ "channel_info_posix.cc" ]
217 "//components/dom_distiller/core", # Needed by chrome_content_client.cc.
223 sources += [ "local_discovery/local_discovery_messages.h" ]
227 sources -= [ "channel_info_posix.cc" ]
229 "//third_party/mach_override",
230 "//third_party/google_toolbox_for_mac",
234 if (enable_plugins) {
241 deps += [ "//third_party/adobe/flash:flapper_version_h" ]
243 if (enable_plugins && enable_extensions) {
245 "pepper_permission_util.cc",
246 "pepper_permission_util.h",
249 if (!enable_webrtc) {
250 sources -= [ "media/webrtc_logging_messages.h" ]
252 if (enable_configuration_policy) {
253 deps += [ "//components/policy" ]
256 if (safe_browsing_mode == 1) {
257 sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
263 # This target allows other targets to depend on result_codes.h which is a
264 # header-only dependency, without bringing in all of content.
265 source_set("result_codes") {
267 "chrome_result_codes.h",
271 process_version("make_chrome_version") {
272 template_file = "chrome_version.cc.version"
273 output = "$target_gen_dir/chrome_version.cc"
276 # GN version: chrome/common_constants.gyp:common_constants
277 static_library("constants") {
279 "chrome_constants.cc",
280 "chrome_constants.h",
281 "chrome_icon_resources_win.cc",
282 "chrome_icon_resources_win.h",
285 "chrome_paths_android.cc",
286 "chrome_paths_internal.h",
287 "chrome_paths_linux.cc",
288 "chrome_paths_mac.mm",
289 "chrome_paths_win.cc",
290 "chrome_switches.cc",
294 "pref_font_script_names-inl.h",
295 "pref_font_webkit_names.h",
298 "widevine_cdm_constants.cc",
299 "widevine_cdm_constants.h",
303 ":make_chrome_version",
305 "//base/third_party/dynamic_annotations",
306 "//components/bookmarks/common",
307 "//third_party/widevine/cdm:version_h",
311 deps += [ "//components/nacl:nacl_switches" ]
315 source_set("test_support") {
317 visibility = [ "//chrome/test:test_support" ]
327 if (is_win || is_mac) {
329 "media_galleries/picasa_test_util.cc",
330 "media_galleries/picasa_test_util.h",
331 "media_galleries/pmp_test_util.cc",
332 "media_galleries/pmp_test_util.h",
336 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
338 if (enable_extensions) {
340 "extensions/extension_test_util.cc",
341 "extensions/extension_test_util.h",
346 # GN version: chrome/chrome.gyp:app_mode_app_support
347 static_library("app_mode_app_support") {
349 "mac/app_mode_chrome_locator.h",
350 "mac/app_mode_chrome_locator.mm",
351 "mac/app_mode_common.h",
352 "mac/app_mode_common.mm",
361 mojom("mojo_bindings") {
363 "resource_usage_reporter.mojom",