File: BUILD.gn

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (120 lines) | stat: -rw-r--r-- 3,270 bytes parent folder | download | duplicates (4)
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",
    ]
  }
}