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("//tools/grit/grit_rule.gni")
10 about_credits_file = "$target_gen_dir/about_credits.html"
11 additional_modules_list_file =
12 "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
14 gypi_values = exec_script(
15 "//build/gypi_to_gn.py",
16 [ rebase_path("../chrome_browser.gypi") ],
18 [ "../chrome_browser.gypi" ])
20 static_library("browser") {
21 configs += [ "//build/config/compiler:wexit_time_destructors" ]
27 # iOS/non-iOS shared deps. New dependencies should generally be added in the
31 "//chrome:extra_resources",
34 "//chrome/app:generated_resources_map",
35 "//chrome/app/resources:platform_locale_settings",
36 "//chrome/app/theme:theme_resources",
37 "//chrome/browser/history:in_memory_url_index_cache_proto",
38 "//chrome/browser/net:cert_logger_proto",
39 "//chrome/browser/net:probe_message_proto",
40 "//chrome/browser/search/suggestions/proto",
42 "//chrome/common/net",
43 "//components/autocomplete",
44 "//components/autofill/core/browser",
45 "//components/captive_portal",
46 "//components/cloud_devices/common",
47 "//components/data_reduction_proxy/browser",
48 "//components/domain_reliability",
49 "//components/favicon_base",
50 "//components/favicon/core",
51 "//components/history/core/browser",
52 "//components/history/core/common",
53 "//components/metrics:net",
54 "//components/navigation_metrics",
55 "//components/os_crypt",
56 "//components/policy:policy_component",
57 "//components/query_parser",
58 "//components/rappor",
59 "//components/strings",
60 "//components/translate/core/browser",
61 "//components/translate/core/common",
62 "//components/url_fixer",
63 "//components/user_prefs",
64 "//content/public/browser",
65 "//content/public/common",
66 "//courgette:courgette_lib",
72 "//third_party/cacheinvalidation",
74 "//third_party/libxml",
75 "//third_party/widevine/cdm:version_h",
77 "//third_party/zlib:minizip",
78 "//third_party/zlib:zip",
87 #"../components/components.gyp:bookmarks_browser",
88 #"../components/components.gyp:feedback_component",
89 #"../components/components.gyp:gcm_driver",
90 #"../components/components.gyp:google_core_browser",
91 #"../components/components.gyp:infobars_core",
92 #"../components/components.gyp:invalidation",
93 #"../components/components.gyp:network_time",
94 #"../components/components.gyp:omaha_query_params",
95 #"../components/components.gyp:password_manager_core_browser",
96 #"../components/components.gyp:password_manager_core_common",
97 #"../components/components.gyp:precache_core",
98 #"../components/components.gyp:search_engines",
99 #"../components/components.gyp:search_provider_logos",
100 #"../components/components.gyp:signin_core_browser",
101 #"../components/components.gyp:startup_metric_utils",
102 #"../components/components.gyp:sync_driver",
103 #"../components/components.gyp:webdata_common",
104 #"../jingle/jingle.gyp:notifier",
105 #"../third_party/libjingle/libjingle.gyp:libjingle",
106 #"../ui/message_center/message_center.gyp:message_center",
107 #"../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs",
110 forward_dependent_configs_from = [
111 "//components/autofill/core/browser",
112 "//content/public/browser",
118 sources += rebase_path(gypi_values.chrome_browser_non_ios_sources,
120 #TODO(GYP) Add these sources:
121 # # These files are generated by GRIT.
122 # '<(grit_out_dir)/grit/component_extension_resources_map.cc',
123 # '<(grit_out_dir)/grit/theme_resources_map.cc',
124 # '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/grit/ui_resources_map.cc',
126 # # This file is generated by
127 # # chrome/browser/metrics/variations/generate_resources_map.py
128 # '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc',
130 # TODO(GYP) Also add these nacl_defines to direct dependents.
131 #defines = nacl_defines
133 # TODO(GYP) remove this when the real webrtc target is used below.
134 configs += [ "//content:webrtc_stub_config" ]
138 "//chrome/browser/performance_monitor",
139 "//chrome/browser/sync_file_system:sync_file_system_proto",
140 "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
141 "//chrome/common/extensions/api:api",
142 "//components/autofill/content/browser",
143 "//components/dom_distiller/content",
144 "//components/keyed_service/content",
145 "//components/translate/content/browser",
146 "//components/url_matcher",
147 "//components/usb_service",
148 "//components/visitedlink/browser",
149 "//components/visitedlink/common",
150 "//components/web_modal",
151 "//mojo/environment:chromium",
152 "//mojo/public/cpp/bindings",
153 "//mojo/public/js/bindings",
156 "//third_party/adobe/flash:flapper_version_h",
157 "//third_party/expat",
158 "//third_party/leveldatabase",
159 "//third_party/libaddressinput",
160 "//third_party/libyuv",
161 "//third_party/npapi",
163 "//third_party/smhasher:cityhash",
168 "//webkit:resources",
169 "//webkit/browser:storage",
171 "//webkit/common:storage",
174 #"browser_extensions",
177 #"../components/components.gyp:navigation_interception",
178 #"../components/components.gyp:password_manager_content_browser",
179 #"../components/components.gyp:precache_content",
180 #"../components/components.gyp:sessions",
181 #"../components/components.gyp:storage_monitor",
182 #"../media/cast/cast.gyp:cast_transport",
183 #"../media/media.gyp:media",
184 ## TODO(tonyg): Remove this dependency (crbug.com/280157).
185 #"../testing/perf/perf_test.gyp:*",
186 # Note: for this one also remove the webrtc_stub_config
187 #"../third_party/webrtc/modules/modules.gyp:desktop_capture",
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) {
234 sources += rebase_path(gypi_values.chrome_browser_extensions_sources,
237 if (enable_background) {
238 sources += rebase_path(gypi_values.chrome_browser_background_sources,
240 if (!use_aura || is_win) {
241 sources -= [ "background/background_mode_manager_aura.cc" ]
244 if (enable_task_manager) {
245 sources += rebase_path(gypi_values.chrome_browser_task_manager_sources,
248 if (enable_spellcheck) {
249 sources += rebase_path(gypi_values.chrome_browser_spellchecker_sources,
251 deps += [ "//third_party/hunspell" ]
254 sources += rebase_path(gypi_values.chrome_browser_nacl_sources,
256 #deps += [ "//components/nacl:nacl_browser" ] TODO(GYP)
258 # ["debug_devtools==1", { TODO(GYP)
260 # "DEBUG_DEVTOOLS=1",
262 if (enable_configuration_policy) {
263 sources += rebase_path(
264 gypi_values.chrome_browser_policy_shared_with_ios_sources,
267 "//components/policy",
268 "//components/policy/proto",
271 sources += rebase_path(
272 gypi_values.chrome_browser_policy_non_ios_sources,
276 sources += rebase_path(
277 gypi_values.chrome_browser_policy_shared_with_ios_not_chromeos_sources,
280 if (is_win || is_mac || is_desktop_linux) {
281 sources += rebase_path(gypi_values.chrome_browser_policy_desktop_sources,
284 if (is_android || is_ios) {
285 sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
287 } else { # Non-mobile
289 #"policy_path_parser", TODO(GYP)
293 # Configuration policy disabled.
294 sources += rebase_path(gypi_values.chrome_browser_policy_disabled_sources,
298 if (enable_plugins) {
299 sources += rebase_path(gypi_values.chrome_browser_plugins_sources,
305 if (safe_browsing_mode != 0) {
306 sources += rebase_path(
307 gypi_values.chrome_browser_basic_safe_browsing_sources,
310 "//chrome/browser/safe_browsing:chunk_proto",
311 "//chrome/browser/safe_browsing:report_proto",
313 if (safe_browsing_mode == 1) {
314 sources += rebase_path(
315 gypi_values.chrome_browser_full_safe_browsing_sources,
317 defines += [ "FULL_SAFE_BROWSING" ]
319 "//chrome/common/safe_browsing:proto",
321 } else if (safe_browsing_mode == 2) {
322 defines += [ "MOBILE_SAFE_BROWSING" ]
327 configs += [ "//build/config/linux:udev" ]
328 deps += [ "//device/media_transfer_protocol" ]
330 if (is_linux && !is_chromeos) {
331 deps += [ "//third_party/speech-dispatcher" ]
335 sources += rebase_path(gypi_values.chrome_browser_chromeos_sources,
338 #"browser_chromeos", TODO(GYP)
342 sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources,
347 configs += [ "//printing:cups" ]
349 if (is_desktop_linux) {
350 sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
352 configs += [ "//build/config/linux:gnome_keyring" ]
355 sources += rebase_path(gypi_values.chrome_browser_aura_sources,
363 if (ui_compositor_image_transport) {
364 deps += [ "//ui/gl" ]
368 sources += rebase_path(gypi_values.chrome_browser_ash_sources,
373 sources += rebase_path(gypi_values.chrome_browser_x11_sources,
376 configs += [ "//build/config/linux:xscrnsaver" ]
379 if (is_posix && !is_mac && !is_ios) {
381 "//chrome/app/chrome_breakpad_client.cc",
382 "//chrome/app/chrome_breakpad_client.h",
385 #"../components/components.gyp:breakpad_component", TODO(GYP)
386 #"../components/components.gyp:breakpad_host", TODO(GYP)
390 sources += rebase_path(gypi_values.chrome_browser_nss_sources,
393 if (enable_notifications) {
394 sources += rebase_path(gypi_values.chrome_browser_notifications_sources,
397 sources += rebase_path(
398 gypi_values.chrome_browser_non_android_notifications_sources,
403 sources += rebase_path(gypi_values.chrome_browser_themes_sources,
407 if (enable_printing != 0) {
408 # Some form of printing support.
409 sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources,
412 #"../printing/printing.gyp:printing", TODO(GYP)
414 if (is_win && win_pdf_metafile_for_printing) {
415 sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
418 if (enable_printing == 1) {
419 # Full printing on top of the above.
420 sources += rebase_path(gypi_values.chrome_browser_full_printing_sources,
422 } else if (enable_printing == 2) {
423 # Partial-only printing support.
424 sources += rebase_path(
425 gypi_values.chrome_browser_basic_only_printing_sources,
429 if (enable_captive_portal_detection) {
430 sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources,
433 if (enable_session_service) {
434 sources += rebase_path(gypi_values.chrome_browser_session_service_sources,
438 if (is_android || is_ios) {
440 sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
444 sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources,
449 sources += rebase_path(gypi_values.chrome_browser_android_sources,
452 #"../components/components.gyp:cdm_browser", TODO(GYP)
453 #"../components/components.gyp:web_contents_delegate_android", TODO(GYP)
454 #"chrome_browser_jni_headers", TODO(GYP)
457 "//third_party/libaddressinput",
458 #"../components/components.gyp:feedback_component", TODO(GYP)
459 #"../components/components.gyp:storage_monitor", TODO(GYP)
460 #"../components/components.gyp:usb_service", TODO(GYP)
461 #"../components/components.gyp:web_modal", TODO(GYP)
464 sources += rebase_path(gypi_values.chrome_browser_non_android_sources,
470 #"../third_party/google_toolbox_for_mac/google_toolbox_for_mac.gyp:google_toolbox_for_mac", TODO(GYP)
471 #"../third_party/mozilla/mozilla.gyp:mozilla", TODO(GYP)
474 "Accelerate.framework",
475 "AddressBook.framework",
476 "AudioUnit.framework",
477 "DiskArbitration.framework",
479 "ImageCaptureCore.framework",
481 "QuartzCore.framework",
482 "SecurityInterface.framework",
487 sources += rebase_path(gypi_values.chrome_browser_rlz_sources,
489 deps += [ "//rlz:rlz_lib" ]
493 # Temporary fix to break the browser target into smaller chunks so it
494 # will link with goma builds.
495 #["OS=="win" and chromium_win_pch==0", {
500 sources += rebase_path(gypi_values.chrome_browser_win_sources,
504 #"chrome_process_finder", TODO(GYP)
505 #"installer_util_strings", TODO(GYP)
506 #"launcher_support", TODO(GYP)
507 #"../chrome/chrome.gyp:chrome_version_header", TODO(GYP)
508 #"../chrome_elf/chrome_elf.gyp:chrome_elf", TODO(GYP)
509 #"../chrome_elf/chrome_elf.gyp:chrome_elf_constants", TODO(GYP)
510 #"../chrome_elf/chrome_elf.gyp:dll_hash", TODO(GYP)
511 #"../google_update/google_update.gyp:google_update", TODO(GYP)
512 #"../third_party/iaccessible2/iaccessible2.gyp:iaccessible2", TODO(GYP)
513 #"../third_party/isimpledom/isimpledom.gyp:isimpledom", TODO(GYP)
514 #"../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages", TODO(GYP)
515 #"../ui/views/controls/webview/webview.gyp:webview", TODO(GYP)
516 #"../ui/views/views.gyp:views", TODO(GYP)
517 #"../win8/win8.gyp:metro_viewer", TODO(GYP)
519 forward_dependent_configs_from += [
520 #"../ui/views/controls/webview/webview.gyp:webview", TODO(GYP)
521 #"../ui/views/views.gyp:views", TODO(GYP)
525 sources += rebase_path(gypi_values.chrome_browser_non_win_sources,
529 #"../ui/views/controls/webview/webview.gyp:webview", TODO(GYP)
530 #"../ui/views/views.gyp:views", TODO(GYP)
532 # TODO(GYP) why is this needed? Very susicious.
534 # "<(INTERMEDIATE_DIR)/chrome",
540 sources += rebase_path(gypi_values.chrome_browser_linux_sources,
544 "//build/config/linux:dbus",
545 "//build/config/linux:fontconfig",
552 configs += [ "//build/config/linux:x11" ]
553 deps += [ "//ui/gfx/x" ]
557 if (is_desktop_linux) {
558 sources += rebase_path(gypi_values.chrome_browser_desktop_linux_sources,
561 if (enable_plugin_installation) {
562 sources += rebase_path(
563 gypi_values.chrome_browser_plugin_installation_sources,
566 if (enable_app_list) {
568 #"../ui/app_list/app_list.gyp:app_list", TODO(GYP)
571 if (enable_managed_users) {
572 sources += rebase_path(
573 gypi_values.chrome_browser_supervised_user_sources,
577 sources += rebase_path(
578 gypi_values.chrome_browser_webrtc_sources,
581 if (enable_service_discovery) {
582 sources += rebase_path(
583 gypi_values.chrome_browser_service_discovery_sources,
587 sources += rebase_path(
588 gypi_values.chrome_browser_mdns_sources,
591 if (!enable_autofill_dialog || is_android || is_ios) {
593 "autofill/validation_rules_storage_factory.cc",
594 "autofill/validation_rules_storage_factory.h",
597 if (enable_wifi_bootstrapping) {
598 sources += rebase_path(
599 gypi_values.chrome_browser_wifi_bootstrapping_sources,
601 if (is_win || is_mac) {
602 # TODO(brettw) as of this writing wifi bootstrapping is set on Windows
603 # and Mac, so this test is meaningless. Can we merge these lists?
604 sources += rebase_path(
605 gypi_values.chrome_browser_win_mac_wifi_bootstrapping_sources,
611 # GYP version: chrome/chrome_resources.gyp:chrome_resources
612 # (generate_browser_resources action)
614 source = "browser_resources.grd"
616 omnibox_mojom_file = "$root_gen_dir/chrome/browser/ui/webui/omnibox/omnibox.mojom.js"
619 "-E", "about_credits_file=" +
620 rebase_path(about_credits_file, root_build_dir),
621 "-E", "additional_modules_list_file=" +
622 rebase_path(additional_modules_list_file, root_build_dir),
623 "-E", "omnibox_mojom_file=" +
624 rebase_path(omnibox_mojom_file, root_build_dir),
629 ":chrome_internal_resources_gen",
630 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
634 # GYP version: chrome/chrome_resource.gyp:about_credits
635 action("about_credits") {
636 script = "//tools/licenses.py"
638 # TODO(phajdan.jr): input dependencies so this can be regenerated
639 # automatically when one of the credits changes. The way this should work is
640 # that licenses.py should write a .d file listing the input dependencies (see
642 outputs = [ about_credits_file ]
646 rebase_path(about_credits_file, root_build_dir),
650 # GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen
651 # TODO(GYP) write internal action
652 if (false) { #if (is_chrome_branded) {
653 action("chrome_internal_resources_gen") {
657 group("chrome_internal_resources_gen") {