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",
147 "//chrome/common/extensions/api:api_registration",
148 "//chrome/installer/util",
149 "//components/autofill/content/browser",
150 "//components/dom_distiller/content",
151 "//components/keyed_service/content",
152 "//components/navigation_interception",
153 "//components/password_manager/content/browser",
154 "//components/precache/content",
155 "//components/sessions",
156 "//components/storage_monitor",
157 "//components/translate/content/browser",
158 "//components/url_matcher",
159 "//components/usb_service",
160 "//components/visitedlink/browser",
161 "//components/visitedlink/common",
162 "//components/web_modal",
163 "//content/app/resources",
166 "//mojo/environment:chromium",
167 "//mojo/public/cpp/bindings",
168 "//mojo/public/js/bindings",
171 "//third_party/WebKit/public:resources",
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 "//chrome/browser/policy:path_parser",
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,
309 "//third_party/adobe/flash:flapper_version_h",
312 if (safe_browsing_mode != 0) {
313 sources += rebase_path(
314 gypi_values.chrome_browser_basic_safe_browsing_sources,
317 "//chrome/browser/safe_browsing:chunk_proto",
318 "//chrome/browser/safe_browsing:report_proto",
320 if (safe_browsing_mode == 1) {
321 sources += rebase_path(
322 gypi_values.chrome_browser_full_safe_browsing_sources,
324 defines += [ "FULL_SAFE_BROWSING" ]
326 "//chrome/common/safe_browsing:proto",
328 } else if (safe_browsing_mode == 2) {
329 defines += [ "MOBILE_SAFE_BROWSING" ]
334 configs += [ "//build/config/linux:udev" ]
335 deps += [ "//device/media_transfer_protocol" ]
337 if (is_linux && !is_chromeos) {
338 deps += [ "//third_party/speech-dispatcher" ]
342 sources += rebase_path(gypi_values.chrome_browser_chromeos_sources,
345 #"browser_chromeos", TODO(GYP)
349 sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources,
354 configs += [ "//printing:cups" ]
356 if (is_desktop_linux) {
357 sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
359 configs += [ "//build/config/linux:gnome_keyring" ]
362 sources += rebase_path(gypi_values.chrome_browser_aura_sources,
370 if (ui_compositor_image_transport) {
371 deps += [ "//ui/gl" ]
375 sources += rebase_path(gypi_values.chrome_browser_ash_sources,
380 sources += rebase_path(gypi_values.chrome_browser_x11_sources,
383 configs += [ "//build/config/linux:xscrnsaver" ]
386 if (is_posix && !is_mac && !is_ios) {
388 "//chrome/app/chrome_breakpad_client.cc",
389 "//chrome/app/chrome_breakpad_client.h",
392 "//components/crash/app",
393 "//components/crash/browser",
397 sources += rebase_path(gypi_values.chrome_browser_nss_sources,
400 if (enable_notifications) {
401 sources += rebase_path(gypi_values.chrome_browser_notifications_sources,
404 sources += rebase_path(
405 gypi_values.chrome_browser_non_android_notifications_sources,
410 sources += rebase_path(gypi_values.chrome_browser_themes_sources,
414 if (printing_mode != 0) {
415 # Some form of printing support.
416 sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources,
421 if (is_win && win_pdf_metafile_for_printing) {
422 sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
425 if (printing_mode == 1) {
426 # Full printing on top of the above.
427 sources += rebase_path(gypi_values.chrome_browser_full_printing_sources,
429 } else if (printing_mode == 2) {
430 # Partial-only printing support.
431 sources += rebase_path(
432 gypi_values.chrome_browser_basic_only_printing_sources,
436 if (enable_captive_portal_detection) {
437 sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources,
440 if (enable_session_service) {
441 sources += rebase_path(gypi_values.chrome_browser_session_service_sources,
445 if (is_android || is_ios) {
447 sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
451 sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources,
456 sources += rebase_path(gypi_values.chrome_browser_android_sources,
459 "//components/cdm/browser",
460 #"../components/components.gyp:web_contents_delegate_android", TODO(GYP)
461 #"chrome_browser_jni_headers", TODO(GYP)
464 "//third_party/libaddressinput",
465 "//components/feedback",
466 "//components/storage_monitor",
467 "//components/usb_service",
468 "//components/web_modal",
471 sources += rebase_path(gypi_values.chrome_browser_non_android_sources,
477 "//third_party/google_toolbox_for_mac",
478 #"../third_party/mozilla/mozilla.gyp:mozilla", TODO(GYP)
481 "Accelerate.framework",
482 "AddressBook.framework",
483 "AudioUnit.framework",
484 "DiskArbitration.framework",
486 "ImageCaptureCore.framework",
488 "QuartzCore.framework",
489 "SecurityInterface.framework",
494 sources += rebase_path(gypi_values.chrome_browser_rlz_sources,
496 deps += [ "//rlz:rlz_lib" ]
500 # Temporary fix to break the browser target into smaller chunks so it
501 # will link with goma builds.
502 #["OS=="win" and chromium_win_pch==0", {
507 sources += rebase_path(gypi_values.chrome_browser_win_sources,
510 "//chrome:version_header",
511 "//chrome/installer/util:strings",
512 "//third_party/iaccessible2",
513 "//third_party/isimpledom",
516 "//ui/views/controls/webview",
517 #"chrome_process_finder", TODO(GYP)
518 #"../chrome_elf/chrome_elf.gyp:chrome_elf", TODO(GYP)
519 #"../chrome_elf/chrome_elf.gyp:chrome_elf_constants", TODO(GYP)
520 #"../chrome_elf/chrome_elf.gyp:dll_hash", TODO(GYP)
521 #"../google_update/google_update.gyp:google_update", TODO(GYP)
522 #"../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages", TODO(GYP)
523 #"../win8/win8.gyp:metro_viewer", TODO(GYP)
525 forward_dependent_configs_from += [
527 "//ui/views/controls/webview",
531 sources += rebase_path(gypi_values.chrome_browser_non_win_sources,
536 "//ui/views/controls/webview",
538 # TODO(GYP) why is this needed? Very susicious.
540 # "<(INTERMEDIATE_DIR)/chrome",
546 sources += rebase_path(gypi_values.chrome_browser_linux_sources,
550 "//build/config/linux:dbus",
551 "//build/config/linux:fontconfig",
558 configs += [ "//build/config/linux:x11" ]
559 deps += [ "//ui/gfx/x" ]
563 if (is_desktop_linux) {
564 sources += rebase_path(gypi_values.chrome_browser_desktop_linux_sources,
567 if (enable_plugin_installation) {
568 sources += rebase_path(
569 gypi_values.chrome_browser_plugin_installation_sources,
572 if (enable_app_list) {
577 if (enable_managed_users) {
578 sources += rebase_path(
579 gypi_values.chrome_browser_supervised_user_sources,
583 sources += rebase_path(
584 gypi_values.chrome_browser_webrtc_sources,
587 if (enable_service_discovery) {
588 sources += rebase_path(
589 gypi_values.chrome_browser_service_discovery_sources,
593 sources += rebase_path(
594 gypi_values.chrome_browser_mdns_sources,
597 if (!enable_autofill_dialog || is_android || is_ios) {
599 "autofill/validation_rules_storage_factory.cc",
600 "autofill/validation_rules_storage_factory.h",
603 if (enable_wifi_bootstrapping) {
604 sources += rebase_path(
605 gypi_values.chrome_browser_wifi_bootstrapping_sources,
607 if (is_win || is_mac) {
608 # TODO(brettw) as of this writing wifi bootstrapping is set on Windows
609 # and Mac, so this test is meaningless. Can we merge these lists?
610 sources += rebase_path(
611 gypi_values.chrome_browser_win_mac_wifi_bootstrapping_sources,
617 # GYP version: chrome/chrome_resources.gyp:chrome_resources
618 # (generate_browser_resources action)
620 source = "browser_resources.grd"
621 output_dir = "$root_gen_dir/chrome"
623 "grit/browser_resources.h",
624 "browser_resources.pak",
627 omnibox_mojom_file = "$root_gen_dir/chrome/browser/ui/webui/omnibox/omnibox.mojom.js"
630 "-E", "about_credits_file=" +
631 rebase_path(about_credits_file, root_build_dir),
632 "-E", "additional_modules_list_file=" +
633 rebase_path(additional_modules_list_file, root_build_dir),
634 "-E", "omnibox_mojom_file=" +
635 rebase_path(omnibox_mojom_file, root_build_dir),
640 ":chrome_internal_resources_gen",
641 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
645 # GYP version: chrome/chrome_resource.gyp:about_credits
646 action("about_credits") {
647 script = "//tools/licenses.py"
649 # TODO(phajdan.jr): input dependencies so this can be regenerated
650 # automatically when one of the credits changes. The way this should work is
651 # that licenses.py should write a .d file listing the input dependencies (see
653 outputs = [ about_credits_file ]
657 rebase_path(about_credits_file, root_build_dir),
661 # GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen
662 # TODO(GYP) write internal action
663 if (false) { #if (is_chrome_branded) {
664 action("chrome_internal_resources_gen") {
668 group("chrome_internal_resources_gen") {