naiveproxy/third_party/blink/renderer/bindings/modules/v8/BUILD.gn
2018-08-14 22:19:20 +00:00

166 lines
5.8 KiB
Plaintext

# 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("//third_party/blink/renderer/bindings/modules/v8/generated.gni")
import("//third_party/blink/renderer/bindings/scripts/scripts.gni")
import("//third_party/blink/renderer/modules/modules.gni")
import("//third_party/blink/renderer/modules/modules_idl_files.gni")
visibility = [ "//third_party/blink/*" ]
group("bindings_modules_v8_generated") {
public_deps = [
":bindings_modules_impl_generated",
":bindings_modules_v8_generated_init_partial",
":generate_bindings_modules_v8_interfaces",
":generate_bindings_modules_v8_partial_interfaces",
":generate_bindings_modules_v8_partial_interfaces_for_testing",
":generate_v8_context_snapshot_external_references",
]
}
idl_compiler("generate_bindings_modules_v8_interfaces") {
sources = modules_definition_idl_files
output_dir = bindings_modules_v8_output_dir
output_name_suffix = ""
target_component = "modules"
}
idl_impl("bindings_modules_impl_generated") {
dict_idls = modules_dictionary_idl_files
non_dict_outputs = bindings_modules_generated_union_type_files +
generated_modules_callback_function_files
non_dict_output_dir = bindings_modules_v8_output_dir
target_component = "modules"
}
idl_compiler("generate_bindings_modules_v8_partial_interfaces") {
sources = core_idl_with_modules_dependency_files
output_dir = bindings_modules_v8_output_dir
output_name_suffix = "_partial"
target_component = "modules"
}
idl_compiler("generate_bindings_modules_v8_partial_interfaces_for_testing") {
sources = webcore_testing_idl_with_modules_dependency_files
output_dir = bindings_modules_v8_output_dir
output_name_suffix = "_partial"
target_component = "modules"
}
generate_origin_trial_features("bindings_modules_origin_trial_features") {
sources =
modules_idl_files + modules_global_constructors_generated_idl_files +
modules_dependency_idl_files
component = "modules"
output_dir = bindings_modules_output_dir + "/v8"
deps = [
"//third_party/blink/renderer/bindings/modules:modules_global_constructors_idls",
]
}
action("bindings_modules_v8_generated_init_partial") {
script = "$bindings_scripts_dir/generate_init_partial_interfaces.py"
inputs = [
"$bindings_modules_output_dir/InterfacesInfoOverall.pickle",
]
outputs = [
bindings_modules_generated_init_partial_interfaces_file,
]
# Put the IDL file list in a response file to avoid command-line limits.
response_file_contents =
rebase_path(core_idl_with_modules_dependency_files, root_build_dir)
args = [
"--idl-files-list",
"{{response_file_name}}",
"--output",
rebase_path(bindings_modules_generated_init_partial_interfaces_file,
root_build_dir),
]
deps = [
"//third_party/blink/renderer/bindings/modules:interfaces_info",
]
}
# Note that this intentionally depends on the generator target of the mojom
# target instead of the mojom target itself directly. This is to ensure that the
# dependencies are header-only and don't link against any bindings code.
group("generate_mojo_bindings") {
visibility = [] # Allow re-assignment of list.
visibility = [ ":*" ]
deps = [
"//device/gamepad/public/mojom:mojom_blink__generator",
"//device/usb/public/mojom:mojom_blink__generator",
"//device/vr/public/mojom:mojom_blink__generator",
"//media/capture/mojom:image_capture_blink__generator",
"//services/device/public/mojom:generic_sensor__generator",
"//services/device/public/mojom:mojom_blink__generator",
"//services/shape_detection/public/mojom:mojom_blink__generator",
"//third_party/blink/public:media_devices_mojo_bindings_blink__generator",
]
}
blink_modules_sources("bindings_modules_impl") {
# ":generate_bindings_modules_v8_partial_interfaces_for_testing" is not
# included here.
sources =
get_target_outputs(":generate_bindings_modules_v8_interfaces") +
get_target_outputs(":bindings_modules_impl_generated") +
get_target_outputs(":generate_bindings_modules_v8_partial_interfaces") +
get_target_outputs(":bindings_modules_v8_generated_init_partial") +
get_target_outputs(":bindings_modules_origin_trial_features")
deps = [
":bindings_modules_origin_trial_features",
":bindings_modules_v8_generated",
":generate_mojo_bindings",
]
if (!is_component_build && is_win) {
# This target as a static library (for non-component builds) is >4GB on
# Windows, this causes linking to fail. As a workaround, split it into
# multiple shards.
split_count = 5
}
}
action("generate_v8_context_snapshot_external_references") {
script = "$bindings_scripts_dir/generate_v8_context_snapshot_external_references.py"
idl_files = core_idl_files + core_idl_with_modules_dependency_files +
modules_definition_idl_files
output = bindings_generated_v8_context_snapshot_external_references_file
inputs = idl_files + [ script ]
outputs = [
output,
]
response_file_contents = rebase_path(idl_files, root_build_dir)
args = [
"--cache-dir",
rebase_path(bindings_scripts_output_dir, root_build_dir),
"--output",
rebase_path(output, root_build_dir),
"--idl-files-list",
"{{response_file_name}}",
"--info-dir",
rebase_path("$bindings_output_dir", root_build_dir),
"--target-component",
"modules",
]
deps = [
"//third_party/blink/renderer/bindings/core:interfaces_info_individual_core",
"//third_party/blink/renderer/bindings/modules:interfaces_info",
"//third_party/blink/renderer/bindings/modules:interfaces_info_individual_modules",
"//third_party/blink/renderer/bindings/scripts:cached_jinja_templates",
"//third_party/blink/renderer/bindings/scripts:cached_lex_yacc_tables",
]
}