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("//build/config/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//components/nacl/nacl_defines.gni")
9 import("//tools/grit/grit_rule.gni")
11 about_credits_file = "$target_gen_dir/about_credits.html"
12 additional_modules_list_file =
13 "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
15 gypi_values = exec_script(
16 "//build/gypi_to_gn.py",
17 [ rebase_path("../chrome_browser.gypi") ],
19 [ "../chrome_browser.gypi" ])
21 static_library("browser") {
22 configs += [ "//build/config/compiler:wexit_time_destructors" ]
28 # iOS/non-iOS shared deps. New dependencies should generally be added in the
32 "//chrome:extra_resources",
35 "//chrome/app:generated_resources_map",
36 "//chrome/app/resources:platform_locale_settings",
37 "//chrome/app/theme:theme_resources",
38 "//chrome/browser/history:in_memory_url_index_cache_proto",
39 "//chrome/browser/net:cert_logger_proto",
40 "//chrome/browser/net:probe_message_proto",
41 "//chrome/browser/ui",
43 "//chrome/common/net",
44 "//components/autofill/core/browser",
45 "//components/captive_portal",
46 "//components/cloud_devices/common",
47 "//components/content_settings/core/common",
48 "//components/crx_file",
49 "//components/data_reduction_proxy/browser",
50 "//components/domain_reliability",
51 "//components/favicon_base",
52 "//components/favicon/core",
53 "//components/feedback",
54 "//components/gcm_driver",
55 "//components/history/core/browser",
56 "//components/history/core/common",
57 "//components/metrics:net",
58 "//components/navigation_metrics",
59 "//components/omnibox",
60 "//components/os_crypt",
61 "//components/policy:policy_component",
62 "//components/query_parser",
63 "//components/rappor",
64 "//components/search",
65 "//components/signin/core/browser",
66 "//components/startup_metric_utils",
67 "//components/strings",
68 "//components/suggestions",
69 "//components/translate/core/browser",
70 "//components/translate/core/common",
71 "//components/url_fixer",
72 "//components/user_prefs",
73 "//components/webdata/common",
74 "//content/public/browser",
75 "//content/public/common",
76 "//courgette:courgette_lib",
83 "//third_party/cacheinvalidation",
85 "//third_party/libxml",
86 "//third_party/libjingle",
87 "//third_party/widevine/cdm:version_h",
89 "//third_party/zlib:minizip",
90 "//third_party/zlib:zip",
95 "//ui/message_center",
100 #"../components/components.gyp:bookmarks_browser",
101 #"../components/components.gyp:google_core_browser",
102 #"../components/components.gyp:infobars_core",
103 #"../components/components.gyp:invalidation",
104 #"../components/components.gyp:network_time",
105 #"../components/components.gyp:omaha_query_params",
106 #"../components/components.gyp:password_manager_core_browser",
107 #"../components/components.gyp:password_manager_core_common",
108 #"../components/components.gyp:precache_core",
109 #"../components/components.gyp:search_engines",
110 #"../components/components.gyp:search_provider_logos",
111 #"../components/components.gyp:sync_driver",
114 forward_dependent_configs_from = [
115 "//components/autofill/core/browser",
116 "//content/public/browser",
122 sources += rebase_path(gypi_values.chrome_browser_non_ios_sources,
124 #TODO(GYP) Add these sources:
125 # # These files are generated by GRIT.
126 # '<(grit_out_dir)/grit/component_extension_resources_map.cc',
127 # '<(grit_out_dir)/grit/theme_resources_map.cc',
128 # '<(SHARED_INTERMEDIATE_DIR)/ui/resources/grit/ui_resources_map.cc',
130 # # This file is generated by
131 # # chrome/browser/metrics/variations/generate_resources_map.py
132 # '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc',
134 defines = nacl_defines
136 # TODO(GYP) remove this when the real webrtc target is used below.
137 configs += [ "//content:webrtc_stub_config" ]
141 "//chrome/browser/devtools",
142 "//chrome/browser/performance_monitor",
143 "//chrome/common/extensions/api:api",
144 "//chrome/installer/util",
145 "//components/autofill/content/browser",
146 "//components/dom_distiller/content",
147 "//components/keyed_service/content",
148 "//components/navigation_interception",
149 "//components/password_manager/content/browser",
150 "//components/precache/content",
151 "//components/sessions",
152 "//components/storage_monitor",
153 "//components/translate/content/browser",
154 "//components/url_matcher",
155 "//components/usb_service",
156 "//components/visitedlink/browser",
157 "//components/visitedlink/common",
158 "//components/web_modal",
159 "//content/app/resources",
162 "//mojo/environment:chromium",
163 "//mojo/public/cpp/bindings",
164 "//mojo/public/js/bindings",
167 "//third_party/WebKit/public:resources",
168 "//third_party/adobe/flash:flapper_version_h",
169 "//third_party/expat",
170 "//third_party/leveldatabase",
171 "//third_party/libaddressinput",
172 "//third_party/libyuv",
173 "//third_party/npapi",
175 "//third_party/smhasher:cityhash",
180 "//webkit/browser:storage",
182 "//webkit/common:storage",
184 ## TODO(tonyg): Remove this dependency (crbug.com/280157).
185 #"../testing/perf/perf_test.gyp:*", TODO(GYP)
186 # Note: for this one also remove the webrtc_stub_config
187 #"../third_party/webrtc/modules/modules.gyp:desktop_capture", TODO(GYP)
190 sources += rebase_path(gypi_values.chrome_browser_ios_sources,
196 "CoreTelephony.framework",
197 "CoreText.framework",
198 "MobileCoreServices.framework",
199 "QuartzCore.framework",
201 ldflags += [ "-weak_framework", "CoreImage" ]
204 if (is_win || is_mac) {
205 sources += rebase_path(gypi_values.chrome_browser_win_mac_sources,
208 if (!is_android && !is_ios && !is_chromeos && enable_configuration_policy) {
210 "net/disk_cache_dir_policy_handler.cc",
211 "net/disk_cache_dir_policy_handler.h",
214 if (!is_android && !is_ios && enable_configuration_policy) {
216 "download/download_dir_policy_handler.cc",
217 "download/download_dir_policy_handler.h",
221 sources += rebase_path(gypi_values.chrome_browser_mac_sources,
224 #"app_shim" TODO(GYP)
227 if (cld2_data_source == "component") {
229 "component_updater/cld_component_installer.cc",
230 "component_updater/cld_component_installer.h",
233 if (enable_extensions) {
235 "//chrome/browser/extensions",
236 "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
238 sources += rebase_path(gypi_values.chrome_browser_extensions_sources,
241 if (enable_background) {
242 sources += rebase_path(gypi_values.chrome_browser_background_sources,
244 if (!use_aura || is_win) {
245 sources -= [ "background/background_mode_manager_aura.cc" ]
248 if (enable_task_manager) {
249 sources += rebase_path(gypi_values.chrome_browser_task_manager_sources,
252 if (enable_spellcheck) {
253 sources += rebase_path(gypi_values.chrome_browser_spellchecker_sources,
255 deps += [ "//third_party/hunspell" ]
258 sources += rebase_path(gypi_values.chrome_browser_nacl_sources,
260 #deps += [ "//components/nacl:nacl_browser" ] TODO(GYP)
262 # ["debug_devtools==1", { TODO(GYP)
264 # "DEBUG_DEVTOOLS=1",
266 if (enable_configuration_policy) {
267 sources += rebase_path(
268 gypi_values.chrome_browser_policy_shared_with_ios_sources,
271 "//components/policy",
272 "//components/policy/proto",
275 sources += rebase_path(
276 gypi_values.chrome_browser_policy_non_ios_sources,
280 sources += rebase_path(
281 gypi_values.chrome_browser_policy_shared_with_ios_not_chromeos_sources,
284 if (is_win || is_mac || is_desktop_linux) {
285 sources += rebase_path(gypi_values.chrome_browser_policy_desktop_sources,
288 if (is_android || is_ios) {
289 sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
291 } else { # Non-mobile
293 #"policy_path_parser", TODO(GYP)
297 # Configuration policy disabled.
298 sources += rebase_path(gypi_values.chrome_browser_policy_disabled_sources,
302 if (enable_plugins) {
303 sources += rebase_path(gypi_values.chrome_browser_plugins_sources,
309 if (safe_browsing_mode != 0) {
310 sources += rebase_path(
311 gypi_values.chrome_browser_basic_safe_browsing_sources,
314 "//chrome/browser/safe_browsing:chunk_proto",
315 "//chrome/browser/safe_browsing:report_proto",
317 if (safe_browsing_mode == 1) {
318 sources += rebase_path(
319 gypi_values.chrome_browser_full_safe_browsing_sources,
321 defines += [ "FULL_SAFE_BROWSING" ]
323 "//chrome/common/safe_browsing:proto",
325 } else if (safe_browsing_mode == 2) {
326 defines += [ "MOBILE_SAFE_BROWSING" ]
331 configs += [ "//build/config/linux:udev" ]
332 deps += [ "//device/media_transfer_protocol" ]
334 if (is_linux && !is_chromeos) {
335 deps += [ "//third_party/speech-dispatcher" ]
339 sources += rebase_path(gypi_values.chrome_browser_chromeos_sources,
342 #"browser_chromeos", TODO(GYP)
346 sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources,
351 configs += [ "//printing:cups" ]
353 if (is_desktop_linux) {
354 sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
356 configs += [ "//build/config/linux:gnome_keyring" ]
359 sources += rebase_path(gypi_values.chrome_browser_aura_sources,
367 if (ui_compositor_image_transport) {
368 deps += [ "//ui/gl" ]
372 sources += rebase_path(gypi_values.chrome_browser_ash_sources,
377 sources += rebase_path(gypi_values.chrome_browser_x11_sources,
380 configs += [ "//build/config/linux:xscrnsaver" ]
383 if (is_posix && !is_mac && !is_ios) {
385 "//chrome/app/chrome_breakpad_client.cc",
386 "//chrome/app/chrome_breakpad_client.h",
389 "//components/breakpad/app",
390 "//components/breakpad/browser",
394 sources += rebase_path(gypi_values.chrome_browser_nss_sources,
397 if (enable_notifications) {
398 sources += rebase_path(gypi_values.chrome_browser_notifications_sources,
401 sources += rebase_path(
402 gypi_values.chrome_browser_non_android_notifications_sources,
407 sources += rebase_path(gypi_values.chrome_browser_themes_sources,
411 if (printing_mode != 0) {
412 # Some form of printing support.
413 sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources,
418 if (is_win && win_pdf_metafile_for_printing) {
419 sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
422 if (printing_mode == 1) {
423 # Full printing on top of the above.
424 sources += rebase_path(gypi_values.chrome_browser_full_printing_sources,
426 } else if (printing_mode == 2) {
427 # Partial-only printing support.
428 sources += rebase_path(
429 gypi_values.chrome_browser_basic_only_printing_sources,
433 if (enable_captive_portal_detection) {
434 sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources,
437 if (enable_session_service) {
438 sources += rebase_path(gypi_values.chrome_browser_session_service_sources,
442 if (is_android || is_ios) {
444 sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
448 sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources,
453 sources += rebase_path(gypi_values.chrome_browser_android_sources,
456 "//components/cdm/browser",
457 #"../components/components.gyp:web_contents_delegate_android", TODO(GYP)
458 #"chrome_browser_jni_headers", TODO(GYP)
461 "//third_party/libaddressinput",
462 "//components/feedback",
463 "//components/storage_monitor",
464 "//components/usb_service",
465 "//components/web_modal",
468 sources += rebase_path(gypi_values.chrome_browser_non_android_sources,
474 "//third_party/google_toolbox_for_mac",
475 #"../third_party/mozilla/mozilla.gyp:mozilla", TODO(GYP)
478 "Accelerate.framework",
479 "AddressBook.framework",
480 "AudioUnit.framework",
481 "DiskArbitration.framework",
483 "ImageCaptureCore.framework",
485 "QuartzCore.framework",
486 "SecurityInterface.framework",
491 sources += rebase_path(gypi_values.chrome_browser_rlz_sources,
493 deps += [ "//rlz:rlz_lib" ]
497 # Temporary fix to break the browser target into smaller chunks so it
498 # will link with goma builds.
499 #["OS=="win" and chromium_win_pch==0", {
504 sources += rebase_path(gypi_values.chrome_browser_win_sources,
507 "//chrome:version_header",
508 "//chrome/installer/util:strings",
509 "//third_party/iaccessible2",
510 "//third_party/isimpledom",
513 "//ui/views/controls/webview",
514 #"chrome_process_finder", TODO(GYP)
515 #"../chrome_elf/chrome_elf.gyp:chrome_elf", TODO(GYP)
516 #"../chrome_elf/chrome_elf.gyp:chrome_elf_constants", TODO(GYP)
517 #"../chrome_elf/chrome_elf.gyp:dll_hash", TODO(GYP)
518 #"../google_update/google_update.gyp:google_update", TODO(GYP)
519 #"../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages", TODO(GYP)
520 #"../win8/win8.gyp:metro_viewer", TODO(GYP)
522 forward_dependent_configs_from += [
524 "//ui/views/controls/webview",
528 sources += rebase_path(gypi_values.chrome_browser_non_win_sources,
533 "//ui/views/controls/webview",
535 # TODO(GYP) why is this needed? Very susicious.
537 # "<(INTERMEDIATE_DIR)/chrome",
543 sources += rebase_path(gypi_values.chrome_browser_linux_sources,
547 "//build/config/linux:dbus",
548 "//build/config/linux:fontconfig",
555 configs += [ "//build/config/linux:x11" ]
556 deps += [ "//ui/gfx/x" ]
560 if (is_desktop_linux) {
561 sources += rebase_path(gypi_values.chrome_browser_desktop_linux_sources,
564 if (enable_plugin_installation) {
565 sources += rebase_path(
566 gypi_values.chrome_browser_plugin_installation_sources,
569 if (enable_app_list) {
574 if (enable_managed_users) {
575 sources += rebase_path(
576 gypi_values.chrome_browser_supervised_user_sources,
580 sources += rebase_path(
581 gypi_values.chrome_browser_webrtc_sources,
584 if (enable_service_discovery) {
585 sources += rebase_path(
586 gypi_values.chrome_browser_service_discovery_sources,
590 sources += rebase_path(
591 gypi_values.chrome_browser_mdns_sources,
594 if (!enable_autofill_dialog || is_android || is_ios) {
596 "autofill/validation_rules_storage_factory.cc",
597 "autofill/validation_rules_storage_factory.h",
600 if (enable_wifi_bootstrapping) {
601 sources += rebase_path(
602 gypi_values.chrome_browser_wifi_bootstrapping_sources,
604 if (is_win || is_mac) {
605 # TODO(brettw) as of this writing wifi bootstrapping is set on Windows
606 # and Mac, so this test is meaningless. Can we merge these lists?
607 sources += rebase_path(
608 gypi_values.chrome_browser_win_mac_wifi_bootstrapping_sources,
614 # GYP version: chrome/chrome_resources.gyp:chrome_resources
615 # (generate_browser_resources action)
617 source = "browser_resources.grd"
618 output_dir = "$root_gen_dir/chrome"
620 "grit/browser_resources.h",
621 "browser_resources.pak",
624 omnibox_mojom_file = "$root_gen_dir/chrome/browser/ui/webui/omnibox/omnibox.mojom.js"
627 "-E", "about_credits_file=" +
628 rebase_path(about_credits_file, root_build_dir),
629 "-E", "additional_modules_list_file=" +
630 rebase_path(additional_modules_list_file, root_build_dir),
631 "-E", "omnibox_mojom_file=" +
632 rebase_path(omnibox_mojom_file, root_build_dir),
637 ":chrome_internal_resources_gen",
638 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
642 # GYP version: chrome/chrome_resource.gyp:about_credits
643 action("about_credits") {
644 script = "//tools/licenses.py"
646 # TODO(phajdan.jr): input dependencies so this can be regenerated
647 # automatically when one of the credits changes. The way this should work is
648 # that licenses.py should write a .d file listing the input dependencies (see
650 outputs = [ about_credits_file ]
654 rebase_path(about_credits_file, root_build_dir),
658 # GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen
659 # TODO(GYP) write internal action
660 if (false) { #if (is_chrome_branded) {
661 action("chrome_internal_resources_gen") {
665 group("chrome_internal_resources_gen") {