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/bookmarks/browser",
46 "//components/captive_portal",
47 "//components/cloud_devices/common",
48 "//components/component_updater",
49 "//components/content_settings/core/common",
50 "//components/crx_file",
51 "//components/data_reduction_proxy/browser",
52 "//components/domain_reliability",
53 "//components/favicon_base",
54 "//components/favicon/core",
55 "//components/feedback",
56 "//components/gcm_driver",
57 "//components/google/core/browser",
58 "//components/history/core/browser",
59 "//components/history/core/common",
60 "//components/infobars/core",
61 "//components/invalidation",
62 "//components/metrics:net",
63 "//components/metrics/proto:proto",
64 "//components/navigation_metrics",
65 "//components/network_time",
66 "//components/omaha_query_params",
67 "//components/omnibox",
68 "//components/os_crypt",
69 "//components/password_manager/core/browser",
70 "//components/password_manager/core/common",
71 "//components/policy:policy_component",
72 "//components/precache/core",
73 "//components/query_parser",
74 "//components/rappor",
75 "//components/renderer_context_menu",
76 "//components/search",
77 "//components/search_engines",
78 "//components/search_provider_logos",
79 "//components/signin/core/browser",
80 "//components/startup_metric_utils",
81 "//components/strings",
82 "//components/suggestions",
83 "//components/sync_driver",
84 "//components/translate/core/browser",
85 "//components/translate/core/common",
86 "//components/url_fixer",
87 "//components/user_prefs",
88 "//components/webdata/common",
89 "//content/public/browser",
90 "//content/public/common",
91 "//courgette:courgette_lib",
98 "//third_party/cacheinvalidation",
100 "//third_party/libxml",
101 "//third_party/libjingle",
102 "//third_party/widevine/cdm:version_h",
103 "//third_party/zlib",
104 "//third_party/zlib:minizip",
105 "//third_party/zlib:zip",
110 "//ui/message_center",
111 "//ui/shell_dialogs",
116 forward_dependent_configs_from = [
117 "//components/autofill/core/browser",
118 "//content/public/browser",
124 sources += rebase_path(gypi_values.chrome_browser_non_ios_sources,
126 #TODO(GYP) Add these sources:
127 # # These files are generated by GRIT.
128 # '<(grit_out_dir)/grit/component_extension_resources_map.cc',
129 # '<(grit_out_dir)/grit/theme_resources_map.cc',
130 # '<(SHARED_INTERMEDIATE_DIR)/ui/resources/grit/ui_resources_map.cc',
132 # # This file is generated by
133 # # chrome/browser/metrics/variations/generate_resources_map.py
134 # '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc',
136 defines = nacl_defines
138 # TODO(GYP) remove this when the real webrtc target is used below.
139 configs += [ "//content:webrtc_stub_config" ]
144 "//chrome/browser/devtools",
145 "//chrome/browser/performance_monitor",
146 "//chrome/common/extensions/api:api",
147 "//chrome/installer/util",
148 "//components/autofill/content/browser",
149 "//components/dom_distiller/content",
150 "//components/keyed_service/content",
151 "//components/navigation_interception",
152 "//components/password_manager/content/browser",
153 "//components/precache/content",
154 "//components/sessions",
155 "//components/storage_monitor",
156 "//components/translate/content/browser",
157 "//components/url_matcher",
158 "//components/usb_service",
159 "//components/visitedlink/browser",
160 "//components/visitedlink/common",
161 "//components/web_modal",
162 "//content/app/resources",
165 "//mojo/environment:chromium",
166 "//mojo/public/cpp/bindings",
167 "//mojo/public/js/bindings",
170 "//third_party/WebKit/public:resources",
171 "//third_party/adobe/flash:flapper_version_h",
172 "//third_party/expat",
173 "//third_party/leveldatabase",
174 "//third_party/libaddressinput",
175 "//third_party/libyuv",
176 "//third_party/npapi",
178 "//third_party/smhasher:cityhash",
183 "//webkit/browser:storage",
185 "//webkit/common:storage",
186 ## TODO(tonyg): Remove this dependency (crbug.com/280157).
187 #"../testing/perf/perf_test.gyp:*", TODO(GYP)
188 # Note: for this one also remove the webrtc_stub_config
189 #"../third_party/webrtc/modules/modules.gyp:desktop_capture", TODO(GYP)
192 sources += rebase_path(gypi_values.chrome_browser_ios_sources,
198 "CoreTelephony.framework",
199 "CoreText.framework",
200 "MobileCoreServices.framework",
201 "QuartzCore.framework",
203 ldflags += [ "-weak_framework", "CoreImage" ]
206 if (is_win || is_mac) {
207 sources += rebase_path(gypi_values.chrome_browser_win_mac_sources,
210 if (!is_android && !is_ios && !is_chromeos && enable_configuration_policy) {
212 "net/disk_cache_dir_policy_handler.cc",
213 "net/disk_cache_dir_policy_handler.h",
216 if (!is_android && !is_ios && enable_configuration_policy) {
218 "download/download_dir_policy_handler.cc",
219 "download/download_dir_policy_handler.h",
223 sources += rebase_path(gypi_values.chrome_browser_mac_sources,
226 #"app_shim" TODO(GYP)
229 if (cld2_data_source == "component") {
231 "component_updater/cld_component_installer.cc",
232 "component_updater/cld_component_installer.h",
235 if (enable_extensions) {
237 "//chrome/browser/extensions",
238 "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
240 sources += rebase_path(gypi_values.chrome_browser_extensions_sources,
243 if (enable_background) {
244 sources += rebase_path(gypi_values.chrome_browser_background_sources,
246 if (!use_aura || is_win) {
247 sources -= [ "background/background_mode_manager_aura.cc" ]
250 if (enable_task_manager) {
251 sources += rebase_path(gypi_values.chrome_browser_task_manager_sources,
254 if (enable_spellcheck) {
255 sources += rebase_path(gypi_values.chrome_browser_spellchecker_sources,
257 deps += [ "//third_party/hunspell" ]
260 sources += rebase_path(gypi_values.chrome_browser_nacl_sources,
262 #deps += [ "//components/nacl:nacl_browser" ] TODO(GYP)
264 # ["debug_devtools==1", { TODO(GYP)
266 # "DEBUG_DEVTOOLS=1",
268 if (enable_configuration_policy) {
269 sources += rebase_path(
270 gypi_values.chrome_browser_policy_shared_with_ios_sources,
273 "//components/policy",
274 "//components/policy/proto",
277 sources += rebase_path(
278 gypi_values.chrome_browser_policy_non_ios_sources,
282 sources += rebase_path(
283 gypi_values.chrome_browser_policy_shared_with_ios_not_chromeos_sources,
286 if (is_win || is_mac || is_desktop_linux) {
287 sources += rebase_path(gypi_values.chrome_browser_policy_desktop_sources,
290 if (is_android || is_ios) {
291 sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
293 } else { # Non-mobile
295 #"policy_path_parser", TODO(GYP)
299 # Configuration policy disabled.
300 sources += rebase_path(gypi_values.chrome_browser_policy_disabled_sources,
304 if (enable_plugins) {
305 sources += rebase_path(gypi_values.chrome_browser_plugins_sources,
311 if (safe_browsing_mode != 0) {
312 sources += rebase_path(
313 gypi_values.chrome_browser_basic_safe_browsing_sources,
316 "//chrome/browser/safe_browsing:chunk_proto",
317 "//chrome/browser/safe_browsing:report_proto",
319 if (safe_browsing_mode == 1) {
320 sources += rebase_path(
321 gypi_values.chrome_browser_full_safe_browsing_sources,
323 defines += [ "FULL_SAFE_BROWSING" ]
325 "//chrome/common/safe_browsing:proto",
327 } else if (safe_browsing_mode == 2) {
328 defines += [ "MOBILE_SAFE_BROWSING" ]
333 configs += [ "//build/config/linux:udev" ]
334 deps += [ "//device/media_transfer_protocol" ]
336 if (is_linux && !is_chromeos) {
337 deps += [ "//third_party/speech-dispatcher" ]
341 sources += rebase_path(gypi_values.chrome_browser_chromeos_sources,
344 #"browser_chromeos", TODO(GYP)
348 sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources,
353 configs += [ "//printing:cups" ]
355 if (is_desktop_linux) {
356 sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
358 configs += [ "//build/config/linux:gnome_keyring" ]
361 sources += rebase_path(gypi_values.chrome_browser_aura_sources,
369 if (ui_compositor_image_transport) {
370 deps += [ "//ui/gl" ]
374 sources += rebase_path(gypi_values.chrome_browser_ash_sources,
379 sources += rebase_path(gypi_values.chrome_browser_x11_sources,
382 configs += [ "//build/config/linux:xscrnsaver" ]
385 if (is_posix && !is_mac && !is_ios) {
387 "//chrome/app/chrome_breakpad_client.cc",
388 "//chrome/app/chrome_breakpad_client.h",
391 "//components/breakpad/app",
392 "//components/breakpad/browser",
396 sources += rebase_path(gypi_values.chrome_browser_nss_sources,
399 if (enable_notifications) {
400 sources += rebase_path(gypi_values.chrome_browser_notifications_sources,
403 sources += rebase_path(
404 gypi_values.chrome_browser_non_android_notifications_sources,
409 sources += rebase_path(gypi_values.chrome_browser_themes_sources,
413 if (printing_mode != 0) {
414 # Some form of printing support.
415 sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources,
420 if (is_win && win_pdf_metafile_for_printing) {
421 sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
424 if (printing_mode == 1) {
425 # Full printing on top of the above.
426 sources += rebase_path(gypi_values.chrome_browser_full_printing_sources,
428 } else if (printing_mode == 2) {
429 # Partial-only printing support.
430 sources += rebase_path(
431 gypi_values.chrome_browser_basic_only_printing_sources,
435 if (enable_captive_portal_detection) {
436 sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources,
439 if (enable_session_service) {
440 sources += rebase_path(gypi_values.chrome_browser_session_service_sources,
444 if (is_android || is_ios) {
446 sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
450 sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources,
455 sources += rebase_path(gypi_values.chrome_browser_android_sources,
458 "//components/cdm/browser",
459 #"../components/components.gyp:web_contents_delegate_android", TODO(GYP)
460 #"chrome_browser_jni_headers", TODO(GYP)
463 "//third_party/libaddressinput",
464 "//components/feedback",
465 "//components/storage_monitor",
466 "//components/usb_service",
467 "//components/web_modal",
470 sources += rebase_path(gypi_values.chrome_browser_non_android_sources,
476 "//third_party/google_toolbox_for_mac",
477 #"../third_party/mozilla/mozilla.gyp:mozilla", TODO(GYP)
480 "Accelerate.framework",
481 "AddressBook.framework",
482 "AudioUnit.framework",
483 "DiskArbitration.framework",
485 "ImageCaptureCore.framework",
487 "QuartzCore.framework",
488 "SecurityInterface.framework",
493 sources += rebase_path(gypi_values.chrome_browser_rlz_sources,
495 deps += [ "//rlz:rlz_lib" ]
499 # Temporary fix to break the browser target into smaller chunks so it
500 # will link with goma builds.
501 #["OS=="win" and chromium_win_pch==0", {
506 sources += rebase_path(gypi_values.chrome_browser_win_sources,
509 "//chrome:version_header",
510 "//chrome/installer/util:strings",
511 "//third_party/iaccessible2",
512 "//third_party/isimpledom",
515 "//ui/views/controls/webview",
516 #"chrome_process_finder", TODO(GYP)
517 #"../chrome_elf/chrome_elf.gyp:chrome_elf", TODO(GYP)
518 #"../chrome_elf/chrome_elf.gyp:chrome_elf_constants", TODO(GYP)
519 #"../chrome_elf/chrome_elf.gyp:dll_hash", TODO(GYP)
520 #"../google_update/google_update.gyp:google_update", TODO(GYP)
521 #"../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages", TODO(GYP)
522 #"../win8/win8.gyp:metro_viewer", TODO(GYP)
524 forward_dependent_configs_from += [
526 "//ui/views/controls/webview",
530 sources += rebase_path(gypi_values.chrome_browser_non_win_sources,
535 "//ui/views/controls/webview",
537 # TODO(GYP) why is this needed? Very susicious.
539 # "<(INTERMEDIATE_DIR)/chrome",
545 sources += rebase_path(gypi_values.chrome_browser_linux_sources,
549 "//build/config/linux:dbus",
550 "//build/config/linux:fontconfig",
557 configs += [ "//build/config/linux:x11" ]
558 deps += [ "//ui/gfx/x" ]
562 if (is_desktop_linux) {
563 sources += rebase_path(gypi_values.chrome_browser_desktop_linux_sources,
566 if (enable_plugin_installation) {
567 sources += rebase_path(
568 gypi_values.chrome_browser_plugin_installation_sources,
571 if (enable_app_list) {
576 if (enable_managed_users) {
577 sources += rebase_path(
578 gypi_values.chrome_browser_supervised_user_sources,
582 sources += rebase_path(
583 gypi_values.chrome_browser_webrtc_sources,
586 if (enable_service_discovery) {
587 sources += rebase_path(
588 gypi_values.chrome_browser_service_discovery_sources,
592 sources += rebase_path(
593 gypi_values.chrome_browser_mdns_sources,
596 if (!enable_autofill_dialog || is_android || is_ios) {
598 "autofill/validation_rules_storage_factory.cc",
599 "autofill/validation_rules_storage_factory.h",
602 if (enable_wifi_bootstrapping) {
603 sources += rebase_path(
604 gypi_values.chrome_browser_wifi_bootstrapping_sources,
606 if (is_win || is_mac) {
607 # TODO(brettw) as of this writing wifi bootstrapping is set on Windows
608 # and Mac, so this test is meaningless. Can we merge these lists?
609 sources += rebase_path(
610 gypi_values.chrome_browser_win_mac_wifi_bootstrapping_sources,
616 # GYP version: chrome/chrome_resources.gyp:chrome_resources
617 # (generate_browser_resources action)
619 source = "browser_resources.grd"
620 output_dir = "$root_gen_dir/chrome"
622 "grit/browser_resources.h",
623 "browser_resources.pak",
626 omnibox_mojom_file = "$root_gen_dir/chrome/browser/ui/webui/omnibox/omnibox.mojom.js"
629 "-E", "about_credits_file=" +
630 rebase_path(about_credits_file, root_build_dir),
631 "-E", "additional_modules_list_file=" +
632 rebase_path(additional_modules_list_file, root_build_dir),
633 "-E", "omnibox_mojom_file=" +
634 rebase_path(omnibox_mojom_file, root_build_dir),
639 ":chrome_internal_resources_gen",
640 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
644 # GYP version: chrome/chrome_resource.gyp:about_credits
645 action("about_credits") {
646 script = "//tools/licenses.py"
648 # TODO(phajdan.jr): input dependencies so this can be regenerated
649 # automatically when one of the credits changes. The way this should work is
650 # that licenses.py should write a .d file listing the input dependencies (see
652 outputs = [ about_credits_file ]
656 rebase_path(about_credits_file, root_build_dir),
660 # GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen
661 # TODO(GYP) write internal action
662 if (false) { #if (is_chrome_branded) {
663 action("chrome_internal_resources_gen") {
667 group("chrome_internal_resources_gen") {