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",
91 "//components/visitedlink/common",
92 "//components/autofill/content/common",
93 "//components/autofill/core/common",
94 "//components/password_manager/content/common",
95 "//components/password_manager/core/common",
96 "//components/signin/core/common",
97 "//components/translate/content/common",
100 "//third_party/widevine/cdm:version_h",
102 public_deps += [ "//third_party/mojo/src/mojo/public/cpp/bindings" ]
105 if (enable_extensions) {
106 sources += rebase_path(gypi_values.chrome_common_extensions_sources,
111 "//chrome/common/extensions/api",
112 "//extensions/common",
113 "//extensions/common/api",
114 "//extensions:extensions_resources",
115 "//extensions/strings",
120 rebase_path(gypi_values.chrome_common_extensions_chromeos_sources,
126 if (is_win || is_mac) {
128 rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome")
129 deps += [ "//breakpad:client" ]
131 if (is_win || is_mac || is_chromeos) {
133 sources += rebase_path(
134 gypi_values.chrome_common_networking_private_sources_openssl,
138 # networking_private_crypto_openssl.cc depends on boringssl.
139 deps += [ "//third_party/boringssl" ]
142 rebase_path(gypi_values.chrome_common_networking_private_sources_nss,
149 rebase_path(gypi_values.chrome_common_mac_sources, ".", "//chrome")
150 deps += [ ":app_mode_app_support" ]
154 deps += [ "//components/nacl:nacl_common" ]
158 if (enable_basic_printing || enable_print_preview) {
160 "//components/printing/common:printing_common",
163 if (enable_print_preview) {
164 # Full printing support.
165 sources += rebase_path(gypi_values.chrome_common_service_process_sources,
171 if (enable_service_discovery) {
173 "local_discovery/service_discovery_client.cc",
174 "local_discovery/service_discovery_client.h",
179 "local_discovery/service_discovery_client_impl.cc",
180 "local_discovery/service_discovery_client_impl.h",
187 "chrome_version_info_posix.cc",
188 "icon_with_badge_image_source.cc",
189 "media_galleries/metadata_types.h",
190 "spellcheck_common.cc",
195 rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome")
199 sources -= [ "chrome_version_info_posix.cc" ]
204 "//components/dom_distiller/core", # Needed by chrome_content_client.cc.
210 sources += [ "local_discovery/local_discovery_messages.h" ]
214 sources -= [ "chrome_version_info_posix.cc" ]
216 "//third_party/mach_override",
217 "//third_party/google_toolbox_for_mac",
221 if (enable_plugins) {
228 deps += [ "//third_party/adobe/flash:flapper_version_h" ]
230 if (enable_plugins && enable_extensions) {
232 "pepper_permission_util.cc",
233 "pepper_permission_util.h",
236 if (!enable_webrtc) {
237 sources -= [ "media/webrtc_logging_messages.h" ]
239 if (enable_configuration_policy) {
240 deps += [ "//components/policy" ]
243 if (safe_browsing_mode == 1) {
244 sources += rebase_path(gypi_values.chrome_common_full_safe_browsing_sources,
250 # This target allows other targets to depend on result_codes.h which is a
251 # header-only dependency, without bringing in all of content.
252 source_set("result_codes") {
254 "chrome_result_codes.h",
258 import("//chrome/version.gni")
259 process_version("version") {
260 visibility = [ ":common" ]
261 template_file = "chrome_version_info_values.h.version"
262 output = "$target_gen_dir/chrome_version_info_values.h"
265 process_version("make_chrome_version") {
266 template_file = "chrome_version.cc.version"
267 output = "$target_gen_dir/chrome_version.cc"
270 # GN version: chrome/common_constants.gyp:common_constants
271 static_library("constants") {
273 "chrome_constants.cc",
274 "chrome_constants.h",
275 "chrome_icon_resources_win.cc",
276 "chrome_icon_resources_win.h",
279 "chrome_paths_android.cc",
280 "chrome_paths_internal.h",
281 "chrome_paths_linux.cc",
282 "chrome_paths_mac.mm",
283 "chrome_paths_win.cc",
284 "chrome_switches.cc",
288 "net/test_server_locations.cc",
289 "net/test_server_locations.h",
290 "pref_font_script_names-inl.h",
291 "pref_font_webkit_names.h",
294 "widevine_cdm_constants.cc",
295 "widevine_cdm_constants.h",
299 ":make_chrome_version",
301 "//base/third_party/dynamic_annotations",
302 "//components/bookmarks/common",
303 "//third_party/widevine/cdm:version_h",
307 deps += [ "//components/nacl:nacl_switches" ]
311 source_set("test_support") {
313 visibility = [ "//chrome/test:test_support" ]
323 if (is_win || is_mac) {
325 "media_galleries/picasa_test_util.cc",
326 "media_galleries/picasa_test_util.h",
327 "media_galleries/pmp_test_util.cc",
328 "media_galleries/pmp_test_util.h",
332 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
334 if (enable_extensions) {
336 "extensions/extension_test_util.cc",
337 "extensions/extension_test_util.h",
342 # GN version: chrome/chrome.gyp:app_mode_app_support
343 static_library("app_mode_app_support") {
345 "mac/app_mode_chrome_locator.h",
346 "mac/app_mode_chrome_locator.mm",
347 "mac/app_mode_common.h",
348 "mac/app_mode_common.mm",
357 mojom("mojo_bindings") {
359 "resource_usage_reporter.mojom",