blob: e059398402b252bd3806d7adb8e64bb078bc5b9f [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/ui.gni")
import("//chrome/common/features.gni")
import("//chromeos/assistant/assistant.gni")
import("//components/gwp_asan/buildflags/buildflags.gni")
import("//components/nacl/features.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
# This target is for dependency tracking for the command ID header.
source_set("command_ids") {
sources = [
"chrome_command_ids.h",
]
}
# TODO: put back in chrome/browser if necessary. http://crbug.com/771801.
source_set("shutdown_signal_handlers") {
if (is_posix || is_fuchsia) {
sources = [
"shutdown_signal_handlers_posix.cc",
"shutdown_signal_handlers_posix.h",
]
}
deps = [
"//base",
]
}
# On Windows, links chrome_dll.rc. On other platforms, does nothing so you can
# unconditionally depend on it.
source_set("chrome_dll_resources") {
# This source is added unconditionally for include checking on non-Windows
# platforms.
sources = [
"chrome_dll_resource.h",
]
deps = [
":command_ids",
]
if (is_win) {
sources += [ "chrome_dll.rc" ]
if (enable_basic_printing) {
# The resource compiler can only handle macro functions up to 31 chars
# which the buildflag system produces for this. Make a define so we can
# toggle off of the enable-basic-printing flag in the .rc file.
defines = [ "ENABLE_PRINTING_FOR_RC" ]
}
deps += [ "//printing/buildflags" ]
}
}
if (is_android) {
import("//build/config/android/rules.gni")
android_generated_java_resources = [
"java/res/values-am/generated_resources.xml",
"java/res/values-ar/generated_resources.xml",
"java/res/values-bg/generated_resources.xml",
"java/res/values-bn/generated_resources.xml",
"java/res/values-ca/generated_resources.xml",
"java/res/values-cs/generated_resources.xml",
"java/res/values-da/generated_resources.xml",
"java/res/values-de/generated_resources.xml",
"java/res/values-el/generated_resources.xml",
"java/res/values-en-rGB/generated_resources.xml",
"java/res/values-es/generated_resources.xml",
"java/res/values-es-rUS/generated_resources.xml",
"java/res/values-et/generated_resources.xml",
"java/res/values-fa/generated_resources.xml",
"java/res/values-fi/generated_resources.xml",
"java/res/values-fr/generated_resources.xml",
"java/res/values-gu/generated_resources.xml",
"java/res/values-hi/generated_resources.xml",
"java/res/values-hr/generated_resources.xml",
"java/res/values-hu/generated_resources.xml",
"java/res/values-in/generated_resources.xml",
"java/res/values-it/generated_resources.xml",
"java/res/values-iw/generated_resources.xml",
"java/res/values-ja/generated_resources.xml",
"java/res/values-kn/generated_resources.xml",
"java/res/values-ko/generated_resources.xml",
"java/res/values-lt/generated_resources.xml",
"java/res/values-lv/generated_resources.xml",
"java/res/values-ml/generated_resources.xml",
"java/res/values-mr/generated_resources.xml",
"java/res/values-ms/generated_resources.xml",
"java/res/values-nb/generated_resources.xml",
"java/res/values-nl/generated_resources.xml",
"java/res/values-pl/generated_resources.xml",
"java/res/values-pt-rBR/generated_resources.xml",
"java/res/values-pt-rPT/generated_resources.xml",
"java/res/values-ro/generated_resources.xml",
"java/res/values-ru/generated_resources.xml",
"java/res/values-sk/generated_resources.xml",
"java/res/values-sl/generated_resources.xml",
"java/res/values-sr/generated_resources.xml",
"java/res/values-sv/generated_resources.xml",
"java/res/values-sw/generated_resources.xml",
"java/res/values-ta/generated_resources.xml",
"java/res/values-te/generated_resources.xml",
"java/res/values-th/generated_resources.xml",
"java/res/values-tl/generated_resources.xml",
"java/res/values-tr/generated_resources.xml",
"java/res/values-uk/generated_resources.xml",
"java/res/values-vi/generated_resources.xml",
"java/res/values-zh-rCN/generated_resources.xml",
"java/res/values-zh-rTW/generated_resources.xml",
"java/res/values/generated_resources.xml",
]
}
grit("generated_resources") {
source = "generated_resources.grd"
defines = chrome_grit_defines
output_dir = "$root_gen_dir/chrome"
outputs = [
"grit/generated_resources.h",
"generated_resources_am.pak",
"generated_resources_ar.pak",
"generated_resources_bg.pak",
"generated_resources_bn.pak",
"generated_resources_ca.pak",
"generated_resources_cs.pak",
"generated_resources_da.pak",
"generated_resources_de.pak",
"generated_resources_el.pak",
"generated_resources_en-GB.pak",
"generated_resources_en-US.pak",
"generated_resources_es.pak",
"generated_resources_es-419.pak",
"generated_resources_et.pak",
"generated_resources_fa.pak",
"generated_resources_fake-bidi.pak",
"generated_resources_fi.pak",
"generated_resources_fil.pak",
"generated_resources_fr.pak",
"generated_resources_gu.pak",
"generated_resources_he.pak",
"generated_resources_hi.pak",
"generated_resources_hr.pak",
"generated_resources_hu.pak",
"generated_resources_id.pak",
"generated_resources_it.pak",
"generated_resources_ja.pak",
"generated_resources_kn.pak",
"generated_resources_ko.pak",
"generated_resources_lt.pak",
"generated_resources_lv.pak",
"generated_resources_ml.pak",
"generated_resources_mr.pak",
"generated_resources_ms.pak",
"generated_resources_nl.pak",
"generated_resources_nb.pak",
"generated_resources_pl.pak",
"generated_resources_pt-BR.pak",
"generated_resources_pt-PT.pak",
"generated_resources_ro.pak",
"generated_resources_ru.pak",
"generated_resources_sk.pak",
"generated_resources_sl.pak",
"generated_resources_sr.pak",
"generated_resources_sv.pak",
"generated_resources_sw.pak",
"generated_resources_ta.pak",
"generated_resources_te.pak",
"generated_resources_th.pak",
"generated_resources_tr.pak",
"generated_resources_uk.pak",
"generated_resources_vi.pak",
"generated_resources_zh-CN.pak",
"generated_resources_zh-TW.pak",
]
if (is_android) {
outputs += android_generated_java_resources
}
}
if (is_android) {
java_strings_grd_prebuilt("java_strings_grd") {
grit_output_dir = "$root_gen_dir/chrome/java/res"
generated_files =
rebase_path(android_generated_java_resources, "java/res", ".")
deps = [
":generated_resources",
]
}
}
grit("google_chrome_strings") {
source = "google_chrome_strings.grd"
defines = chrome_grit_defines
output_dir = "$root_gen_dir/chrome"
outputs = [
"grit/google_chrome_strings.h",
"google_chrome_strings_am.pak",
"google_chrome_strings_ar.pak",
"google_chrome_strings_bg.pak",
"google_chrome_strings_bn.pak",
"google_chrome_strings_ca.pak",
"google_chrome_strings_cs.pak",
"google_chrome_strings_da.pak",
"google_chrome_strings_de.pak",
"google_chrome_strings_el.pak",
"google_chrome_strings_en-GB.pak",
"google_chrome_strings_en-US.pak",
"google_chrome_strings_es.pak",
"google_chrome_strings_es-419.pak",
"google_chrome_strings_et.pak",
"google_chrome_strings_fa.pak",
"google_chrome_strings_fi.pak",
"google_chrome_strings_fil.pak",
"google_chrome_strings_fr.pak",
"google_chrome_strings_gu.pak",
"google_chrome_strings_he.pak",
"google_chrome_strings_hi.pak",
"google_chrome_strings_hr.pak",
"google_chrome_strings_hu.pak",
"google_chrome_strings_id.pak",
"google_chrome_strings_it.pak",
"google_chrome_strings_ja.pak",
"google_chrome_strings_kn.pak",
"google_chrome_strings_ko.pak",
"google_chrome_strings_lt.pak",
"google_chrome_strings_lv.pak",
"google_chrome_strings_ml.pak",
"google_chrome_strings_mr.pak",
"google_chrome_strings_ms.pak",
"google_chrome_strings_nl.pak",
"google_chrome_strings_nb.pak",
"google_chrome_strings_pl.pak",
"google_chrome_strings_pt-BR.pak",
"google_chrome_strings_pt-PT.pak",
"google_chrome_strings_ro.pak",
"google_chrome_strings_ru.pak",
"google_chrome_strings_sk.pak",
"google_chrome_strings_sl.pak",
"google_chrome_strings_sr.pak",
"google_chrome_strings_sv.pak",
"google_chrome_strings_sw.pak",
"google_chrome_strings_ta.pak",
"google_chrome_strings_te.pak",
"google_chrome_strings_th.pak",
"google_chrome_strings_tr.pak",
"google_chrome_strings_uk.pak",
"google_chrome_strings_vi.pak",
"google_chrome_strings_zh-CN.pak",
"google_chrome_strings_zh-TW.pak",
"google_chrome_strings_fake-bidi.pak",
]
}
grit("chromium_strings") {
source = "chromium_strings.grd"
defines = chrome_grit_defines
output_dir = "$root_gen_dir/chrome"
outputs = [
"grit/chromium_strings.h",
"chromium_strings_am.pak",
"chromium_strings_ar.pak",
"chromium_strings_bg.pak",
"chromium_strings_bn.pak",
"chromium_strings_ca.pak",
"chromium_strings_cs.pak",
"chromium_strings_da.pak",
"chromium_strings_de.pak",
"chromium_strings_el.pak",
"chromium_strings_en-GB.pak",
"chromium_strings_en-US.pak",
"chromium_strings_es.pak",
"chromium_strings_es-419.pak",
"chromium_strings_et.pak",
"chromium_strings_fa.pak",
"chromium_strings_fake-bidi.pak",
"chromium_strings_fi.pak",
"chromium_strings_fil.pak",
"chromium_strings_fr.pak",
"chromium_strings_gu.pak",
"chromium_strings_he.pak",
"chromium_strings_hi.pak",
"chromium_strings_hr.pak",
"chromium_strings_hu.pak",
"chromium_strings_id.pak",
"chromium_strings_it.pak",
"chromium_strings_ja.pak",
"chromium_strings_kn.pak",
"chromium_strings_ko.pak",
"chromium_strings_lt.pak",
"chromium_strings_lv.pak",
"chromium_strings_ml.pak",
"chromium_strings_mr.pak",
"chromium_strings_ms.pak",
"chromium_strings_nl.pak",
"chromium_strings_nb.pak",
"chromium_strings_pl.pak",
"chromium_strings_pt-BR.pak",
"chromium_strings_pt-PT.pak",
"chromium_strings_ro.pak",
"chromium_strings_ru.pak",
"chromium_strings_sk.pak",
"chromium_strings_sl.pak",
"chromium_strings_sr.pak",
"chromium_strings_sv.pak",
"chromium_strings_sw.pak",
"chromium_strings_ta.pak",
"chromium_strings_te.pak",
"chromium_strings_th.pak",
"chromium_strings_tr.pak",
"chromium_strings_uk.pak",
"chromium_strings_vi.pak",
"chromium_strings_zh-CN.pak",
"chromium_strings_zh-TW.pak",
]
}
static_library("test_support") {
testonly = true
visibility = [ "//chrome/test:test_support" ]
sources = [
"chrome_main_delegate.cc",
"chrome_main_delegate.h",
]
deps = [
"//base",
"//chrome/app:shutdown_signal_handlers",
"//chrome/browser",
"//chrome/browser/policy:path_parser",
"//chrome/child",
"//chrome/common",
"//chrome/gpu",
"//chrome/renderer",
"//chrome/utility",
"//components/gwp_asan/buildflags",
"//components/nacl/common:buildflags",
"//components/startup_metric_utils/browser:lib",
"//components/tracing",
"//content/public/app:both",
"//content/public/common",
"//content/public/common:service_names",
"//pdf",
"//ppapi/buildflags",
"//printing/buildflags",
"//services/service_manager/embedder",
"//ui/base",
"//v8:v8_headers",
]
if (!is_fuchsia) {
# TODO(crbug.com/753619): Enable crash reporting on Fuchsia.
deps += [
"//components/crash/content/app",
"//components/crash/content/app:test_support",
]
}
if (is_mac) {
sources += [ "chrome_main_mac.mm" ]
deps += [ "//chrome:chrome_framework" ]
}
if (is_win) {
deps += [
"//chrome:chrome_initial",
"//chrome/install_static:install_static_util",
"//chrome_elf:test_stubs",
"//sandbox/win:sandbox",
]
}
if (is_chromeos) {
deps += [ "//chrome/browser/chromeos" ]
}
if (enable_plugins && enable_nacl) {
deps += [
"//components/nacl/browser",
"//components/nacl/renderer/plugin:nacl_trusted_plugin",
]
}
if (enable_mus) {
deps += [
"//ash/components/quick_launch/public/mojom:constants",
"//services/ws/public/mojom:constants",
]
}
if (enable_gwp_asan) {
deps += [ "//components/gwp_asan/client" ]
}
}
source_set("chrome_content_browser_overlay_manifest") {
sources = [
"chrome_content_browser_overlay_manifest.cc",
"chrome_content_browser_overlay_manifest.h",
]
deps = [
"//base",
"//chrome/browser/engagement:mojo_bindings",
"//chrome/browser/media:mojo_bindings",
"//chrome/browser/ui/webui/bluetooth_internals:mojo_bindings",
"//chrome/browser/ui/webui/downloads:mojo_bindings",
"//chrome/browser/ui/webui/feed_internals:mojo_bindings",
"//chrome/browser/ui/webui/interventions_internals:mojo_bindings",
"//chrome/browser/ui/webui/omnibox:mojo_bindings",
"//chrome/browser/ui/webui/reset_password:mojo_bindings",
"//chrome/browser/ui/webui/snippets_internals:mojo_bindings",
"//chrome/browser/ui/webui/usb_internals:mojo_bindings",
"//chrome/common:available_offline_content_mojom",
"//chrome/common:mojo_bindings",
"//chrome/common:offline_page_auto_fetcher_mojom",
"//chrome/common:page_load_metrics_mojom",
"//chrome/common/media_router/mojo:media_router",
"//chrome/test/data:web_ui_test_bindings",
"//components/autofill/content/common:mojo_interfaces",
"//components/contextual_search/content:mojo_bindings",
"//components/data_reduction_proxy/core/common:interfaces",
"//components/dom_distiller/content/common:mojo_bindings",
"//components/metrics/public/interfaces:call_stack_mojo_bindings",
"//components/rappor/public/interfaces",
"//components/safe_browsing/common:interfaces",
"//components/services/heap_profiling/public/mojom",
"//components/translate/content/common",
"//extensions/buildflags",
"//services/identity/public/cpp:manifest",
"//services/image_annotation/public/cpp:manifest",
"//services/preferences/public/cpp:manifest",
"//services/service_manager/public/cpp",
"//services/ws/common",
"//third_party/blink/public/common",
]
if (enable_extensions) {
deps += [
"//extensions/common:mojo",
"//extensions/common/api:mojom",
]
}
if (is_chromeos) {
deps += [
"//ash/components/shortcut_viewer/public/cpp:manifest",
"//ash/components/shortcut_viewer/public/mojom",
"//ash/components/tap_visualizer/public/cpp:manifest",
"//ash/components/tap_visualizer/public/mojom",
"//chromeos/assistant:buildflags",
"//chromeos/services/device_sync/public/cpp:manifest",
"//chromeos/services/ime/public/mojom",
"//chromeos/services/media_perception/public/mojom",
"//chromeos/services/multidevice_setup/public/cpp:manifest",
"//chromeos/services/multidevice_setup/public/mojom",
"//ui/accessibility/mojom",
]
if (enable_cros_assistant) {
deps += [ "//chromeos/services/assistant/public/cpp:manifest" ]
}
}
if (is_android) {
deps += [ "//chrome/browser/ui/webui/eoc_internals:mojo_bindings" ]
} else {
deps += [
"//chrome/browser/ui/webui/app_management:mojo_bindings",
"//chrome/services/app_service/public/cpp:manifest",
]
}
if (is_win || is_mac || is_desktop_linux || is_chromeos) {
deps += [
"//chrome/browser/ui/webui/discards:mojo_bindings",
"//services/resource_coordinator/public/mojom",
]
}
}
source_set("chrome_content_gpu_overlay_manifest") {
sources = [
"chrome_content_gpu_overlay_manifest.cc",
"chrome_content_gpu_overlay_manifest.h",
]
deps = [
"//base",
"//components/services/heap_profiling/public/mojom",
"//services/service_manager/public/cpp",
]
if (is_chromeos) {
deps += [ "//components/arc/common:media" ]
}
}
source_set("chrome_content_renderer_overlay_manifest") {
sources = [
"chrome_content_renderer_overlay_manifest.cc",
"chrome_content_renderer_overlay_manifest.h",
]
deps = [
"//base",
"//chrome/common:mojo_bindings",
"//chrome/common:search_mojom",
"//components/autofill/content/common:mojo_interfaces",
"//components/dom_distiller/content/common:mojo_bindings",
"//components/metrics/public/interfaces:call_stack_mojo_bindings",
"//components/rappor/public/interfaces",
"//components/safe_browsing/common:interfaces",
"//components/services/heap_profiling/public/mojom",
"//components/subresource_filter/content/mojom",
"//extensions/buildflags",
"//services/service_manager/public/cpp",
"//third_party/blink/public/common",
]
if (is_mac) {
deps += [ "//components/spellcheck/common:interfaces" ]
}
if (enable_extensions) {
deps += [ "//extensions/common:mojo" ]
}
}
source_set("chrome_content_utility_overlay_manifest") {
sources = [
"chrome_content_utility_overlay_manifest.cc",
"chrome_content_utility_overlay_manifest.h",
]
deps = [
"//base",
"//components/services/heap_profiling/public/mojom",
"//services/service_manager/public/cpp",
]
}
source_set("chrome_packaged_service_manifests") {
sources = [
"chrome_packaged_service_manifests.cc",
"chrome_packaged_service_manifests.h",
]
deps = [
"//base",
"//chrome/common:buildflags",
"//chrome/common:mojo_bindings",
"//chrome/services/file_util/public/cpp:manifest",
"//chrome/services/noop/public/cpp:manifest",
"//components/services/patch/public/cpp:manifest",
"//components/services/unzip/public/cpp:manifest",
"//components/spellcheck/common:interfaces",
"//components/startup_metric_utils/common:interfaces",
"//device/vr/buildflags",
"//extensions/buildflags",
"//printing/buildflags",
"//services/preferences/public/cpp:local_state_manifest",
"//services/proxy_resolver/public/cpp:manifest",
"//services/service_manager/public/cpp",
]
if (enable_extensions) {
deps += [ "//chrome/services/removable_storage_writer/public/cpp:manifest" ]
}
if (enable_extensions || is_android) {
deps += [ "//chrome/services/media_gallery_util/public/cpp:manifest" ]
}
if (enable_basic_printing) {
deps += [ "//components/services/pdf_compositor/public/cpp:manifest" ]
}
if (enable_print_preview) {
deps += [ "//chrome/services/printing/public/cpp:manifest" ]
}
if (enable_isolated_xr_service) {
deps += [ "//chrome/services/isolated_xr_device:manifest" ]
}
if (enable_simple_browser_service_in_process ||
enable_simple_browser_service_out_of_process) {
deps += [ "//services/content/simple_browser/public/cpp:manifest" ]
}
if (is_win) {
deps += [
"//chrome/services/util_win/public/cpp:manifest",
"//chrome/services/wifi_util_win/public/cpp:manifest",
]
}
if (is_chromeos) {
deps += [
"//ash/components/quick_launch/public/cpp:manifest",
"//ash/components/shortcut_viewer/public/cpp:manifest",
"//ash/components/tap_visualizer/public/cpp:manifest",
"//ash/public/cpp:manifest",
"//chrome/browser/chromeos:ash_pref_connector_manifest",
"//chrome/services/cups_ipp_parser/public/cpp:manifest",
"//chromeos/services/ime/public/cpp:manifest",
"//chromeos/services/secure_channel/public/cpp:manifest",
"//mash/public/mojom",
"//services/ws/public/mojom/input_devices",
"//ui/accessibility:ax_host_manifest",
]
}
if (!is_android) {
deps += [
"//chrome/utility:profile_import_manifest",
"//components/mirroring/service:manifest",
]
}
}
source_set("chrome_renderer_manifest") {
sources = [
"chrome_renderer_manifest.cc",
"chrome_renderer_manifest.h",
]
deps = [
"//base",
"//chrome/common:mojo_bindings",
"//components/safe_browsing/common:interfaces",
"//components/spellcheck/common:interfaces",
"//services/service_manager/public/cpp",
]
}
source_set("chrome_service_manifests") {
public_deps = [
":chrome_content_browser_overlay_manifest",
":chrome_content_gpu_overlay_manifest",
":chrome_content_renderer_overlay_manifest",
":chrome_content_utility_overlay_manifest",
":chrome_packaged_service_manifests",
":chrome_renderer_manifest",
]
}