blob: 66b6979cb954e68aa13e8502e430e383b49ed89c [file] [log] [blame]
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//chrome/common/extensions/api/api_sources.gni")
import("//chrome/common/features.gni")
import("//extensions/buildflags/buildflags.gni")
import("//pdf/features.gni")
import("//tools/json_schema_compiler/json_schema_api.gni")
assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")
# This should be:
# The set of all targets needed to build out the extension API implementations
# and any necessary steps to register or instantiate them.
# Embedders should usually depend on this.
# Right now, there's currently a number of other targets that are (not ideally)
# sharded out. See https://crbug.com/883570.
group("api") {
public_deps = [ "//chrome/browser/extensions/api:api_implementations" ]
}
# The collection of API implementations.
group("api_implementations") {
# TODO(crbug.com/1381603): Add more API implementations here.
public_deps = [
"//chrome/browser/extensions/api/command_line_private",
"//chrome/browser/extensions/api/module",
"//chrome/browser/extensions/api/page_capture",
"//chrome/browser/extensions/api/scripting",
]
if (enable_pdf) {
public_deps += [ "//chrome/browser/extensions/api/pdf_viewer_private" ]
}
if (is_chromeos) {
public_deps +=
[ "//chrome/browser/chromeos/extensions/smart_card_provider_private" ]
}
}
# The step necessary to generate the code to register the corresponding
# ExtensionFunctions in order to map the function string name with their
# implementation.
function_registration("api_registration") {
sources = chrome_extensions_api_schema_sources +
chrome_extensions_api_uncompiled_sources
impl_dir = "//chrome/browser/extensions/api"
configs = [ "//build/config:precompiled_headers" ]
bundle_name = "Chrome"
root_namespace = chrome_extensions_api_root_namespace
schema_include_rules = chrome_extensions_api_schema_include_rules
deps = [
# This is not directly included by the target, but specified here
# to avoid cyclic dependency chain related to private_membership
# protos.
"//components/policy/proto",
# Different APIs include headers from these targets.
"//chrome/common",
"//chrome/common:mojo_bindings",
"//components/autofill/core/common/mojom:mojo_types",
"//components/omnibox/browser",
"//components/translate/core/browser",
"//components/zoom",
"//content/public/browser",
"//extensions/browser",
"//extensions/browser/api:api_implementations",
"//extensions/common/api",
# Different APIs include some headers from chrome/common that in turn
# include generated headers from these targets.
# TODO(brettw) this should be made unnecessary if possible.
"//chrome/common/extensions/api",
"//components/sync",
"//skia",
"//third_party/metrics_proto",
"//ui/accessibility:ax_enums_mojo",
]
if (is_chromeos) {
deps += [ "//chrome/browser/chromeos/extensions:constants" ]
}
}
if (is_win) {
executable("native_messaging_test_echo_host") {
testonly = true
sources = [ "messaging/native_messaging_test_echo_host.cc" ]
deps = [ "//base" ]
}
}