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")
43 configs += [ "//build/config/compiler:wexit_time_destructors" ]
46 "//chrome/common:constants",
47 "//chrome/common/net",
48 "//chrome/common/safe_browsing:proto",
58 "//chrome/app/theme:theme_resources",
59 "//chrome/installer/util",
60 "//components/cloud_devices/common",
61 "//components/component_updater",
62 "//components/content_settings/core/common",
63 "//components/favicon_base",
64 "//components/json_schema",
65 "//components/metrics",
66 "//components/policy:policy_component_common",
67 "//components/translate/core/common",
68 "//components/variations",
69 "//content/public/common",
71 "//extensions/common:common_constants",
75 "//third_party/libxml",
76 "//third_party/sqlite",
77 "//third_party/zlib:zip",
78 "//ui/resources:resources",
84 # Use this Mac file that was filtered out.
85 "chrome_version_info_mac.mm",
88 "resource_usage_reporter_type_converters.cc",
89 "resource_usage_reporter_type_converters.h",
95 "//components/visitedlink/common",
96 "//components/autofill/content/common",
97 "//components/autofill/core/common",
98 "//components/password_manager/content/common",
99 "//components/password_manager/core/common",
100 "//components/signin/core/common",
101 "//components/translate/content/common",
104 "//third_party/widevine/cdm:version_h",
106 public_deps += [ "//third_party/mojo/src/mojo/public/cpp/bindings" ]
109 if (enable_extensions) {
110 sources += rebase_path(gypi_values.chrome_common_extensions_sources,
115 "//chrome/common/extensions/api",
116 "//extensions/common",
117 "//extensions/common/api",
118 "//extensions:extensions_resources",
119 "//extensions/strings",
124 rebase_path(gypi_values.chrome_common_extensions_chromeos_sources,
130 if (is_win || is_mac) {
132 rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
133 deps += [ "//breakpad:client" ]
135 if (is_win || is_mac || is_chromeos) {
137 sources += rebase_path(
138 gypi_values.chrome_common_networking_private_sources_openssl,
142 # networking_private_crypto_openssl.cc depends on boringssl.
143 deps += [ "//third_party/boringssl" ]
146 rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
153 rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
154 deps += [ ":app_mode_app_support" ]
158 deps += [ "//components/nacl:nacl_common" ]
162 if (enable_basic_printing || enable_print_preview) {
164 "//components/printing/common:printing_common",
167 if (enable_print_preview) {
168 # Full printing support.
169 sources += rebase_path(gypi_values.chrome_common_service_process_sources,
175 if (enable_service_discovery) {
177 "local_discovery/service_discovery_client.cc",
178 "local_discovery/service_discovery_client.h",
183 "local_discovery/service_discovery_client_impl.cc",
184 "local_discovery/service_discovery_client_impl.h",
191 "chrome_version_info_posix.cc",
192 "icon_with_badge_image_source.cc",
193 "media_galleries/metadata_types.h",
194 "spellcheck_common.cc",
199 rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
203 sources -= [ "chrome_version_info_posix.cc" ]
208 "//components/dom_distiller/core", # Needed by chrome_content_client.cc.
214 sources += [ "local_discovery/local_discovery_messages.h" ]
218 sources -= [ "chrome_version_info_posix.cc" ]
220 "//third_party/mach_override",
221 "//third_party/google_toolbox_for_mac",
225 if (enable_plugins) {
232 deps += [ "//third_party/adobe/flash:flapper_version_h" ]
234 if (enable_plugins && enable_extensions) {
236 "pepper_permission_util.cc",
237 "pepper_permission_util.h",
240 if (!enable_webrtc) {
241 sources -= [ "media/webrtc_logging_messages.h" ]
243 if (enable_configuration_policy) {
244 deps += [ "//components/policy" ]
247 if (safe_browsing_mode == 1) {
248 sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
254 # This target allows other targets to depend on result_codes.h which is a
255 # header-only dependency, without bringing in all of content.
256 source_set("result_codes") {
258 "chrome_result_codes.h",
262 import("//chrome/version.gni")
263 process_version("version") {
264 visibility = [ ":common" ]
265 template_file = "chrome_version_info_values.h.version"
266 output = "$target_gen_dir/chrome_version_info_values.h"
269 process_version("make_chrome_version") {
270 template_file = "chrome_version.cc.version"
271 output = "$target_gen_dir/chrome_version.cc"
274 # GN version: chrome/common_constants.gyp:common_constants
275 static_library("constants") {
277 "chrome_constants.cc",
278 "chrome_constants.h",
279 "chrome_icon_resources_win.cc",
280 "chrome_icon_resources_win.h",
283 "chrome_paths_android.cc",
284 "chrome_paths_internal.h",
285 "chrome_paths_linux.cc",
286 "chrome_paths_mac.mm",
287 "chrome_paths_win.cc",
288 "chrome_switches.cc",
292 "net/test_server_locations.cc",
293 "net/test_server_locations.h",
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",