1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/nocompile.gni")
import("//third_party/blink/renderer/core/core.gni")
template("probe_generator") {
assert(defined(invoker.probe_set))
assert(defined(invoker.probe_sink))
assert(defined(invoker.output))
generated_target_name = target_name + "__generated"
action(generated_target_name) {
script = "../../build/scripts/make_instrumenting_probes.py"
inputs = [
"${invoker.probe_set}.pidl",
"${invoker.probe_set}.json5",
"../../build/scripts/templates/instrumenting_probes_impl.cc.tmpl",
"../../build/scripts/templates/instrumenting_probes_inl.h.tmpl",
"../../build/scripts/templates/probe_sink.h.tmpl",
]
outputs = [
"${invoker.output}/${invoker.probe_set}_inl.h",
"${invoker.output}/${invoker.probe_set}_impl.cc",
"${invoker.output}/${invoker.probe_sink}.h",
]
args = [
rebase_path(inputs[0], root_build_dir),
"--config",
rebase_path("${invoker.probe_set}.json5", root_build_dir),
"--output_dir",
rebase_path(invoker.output, root_build_dir),
]
}
source_set("${target_name}__headers") {
sources = [
"${invoker.output}/${invoker.probe_set}_inl.h",
"${invoker.output}/${invoker.probe_sink}.h",
]
deps = [ "//third_party/blink/renderer/platform" ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
public_deps = [ ":${generated_target_name}" ]
}
if (!defined(invoker.is_test) || !invoker.is_test) {
blink_core_sources(target_name) {
sources = [ "${invoker.output}/${invoker.probe_set}_impl.cc" ]
public_deps = [ ":${target_name}__headers" ]
}
}
}
probe_generator("instrumentation_probes") {
probe_set = "core_probes"
probe_sink = "core_probe_sink"
output = blink_core_output_dir
deps = [ "//third_party/blink/renderer/bindings:buildflags" ]
}
source_set("generated") {
deps = [ ":instrumentation_probes__generated" ]
}
# Compiles the sources generated above.
blink_core_sources("probe") {
sources = [
"async_task_context.cc",
"async_task_context.h",
"core_probes.cc",
"core_probes.h",
]
deps = [
"//skia",
"//third_party/blink/renderer/bindings/core/v8:generated",
"//third_party/blink/renderer/core:all_generators",
"//third_party/blink/renderer/platform/wtf",
"//v8",
]
public_deps = [ ":instrumentation_probes" ]
}
if (enable_nocompile_tests) {
probe_generator("test_probes") {
probe_set = "test_probes"
probe_sink = "test_probe_sink"
output = "${blink_core_output_dir}/probe"
is_test = true
}
group("blink_probes_nocompile_tests") {
# TODO(crbug.com/1480969): Empty placeholder group until the legacy
# nocompile targets are deleted from the buildbot configs.
}
nocompile_source_set("probe_nocompile_tests") {
sources = [ "probe_nocompile.nc" ]
deps = [
# We don't want to test compile errors for test_probes_impl.cc.
# So, it depends on "test_probes__headers" instead of "test_probes".
":test_probes__headers",
"//third_party/blink/renderer/platform/wtf",
"//v8",
]
}
}
|