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 (106 lines) | stat: -rw-r--r-- 3,552 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
# Copyright 2024 The Chromium Authors
# 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/build/scripts/scripts.gni")
import("//third_party/blink/renderer/core/core.gni")

blink_python_runner("generate_builtins_all_known") {
  script = "builtins_all_known.py"
  outputs = [ "$target_gen_dir/builtins_all_known.json" ]
  sources = [
    "../html/aria_properties.json5",
    "../html/html_attribute_names.json5",
    "../html/html_tag_names.json5",
    "../mathml/mathml_attribute_names.json5",
    "../mathml/mathml_tag_names.json5",
    "../svg/svg_attribute_names.json5",
    "../svg/svg_tag_names.json5",
    "../svg/xlink_attribute_names.json5",
    "../xml/xml_attribute_names.json5",
    "../xml/xmlns_attribute_names.json5",
  ]
  inputs = sources + scripts_for_json5_files
  args = [
           "--out",
           rebase_path(outputs[0], root_build_dir),
         ] + rebase_path(sources, root_build_dir)
}

action("generate_builtins_default_config") {
  script = "builtins_generate_config.py"
  sources = [ "builtins_default_config.json" ]
  outputs = [ "$target_gen_dir/builtins_default.cc" ]
  allknown = get_target_outputs(":generate_builtins_all_known")
  args = [
    "--default-configuration",
    rebase_path(sources[0], root_build_dir),
    "--out",
    rebase_path(outputs[0], root_build_dir),
    "--name",
    "BuildDefaultConfig",
    "--all-known",
    rebase_path(allknown[0], root_build_dir),
  ]
  deps = [ ":generate_builtins_all_known" ]
}

action("generate_builtins_baseline_config") {
  script = "builtins_generate_config.py"
  sources = [ "builtins_baseline_config.json" ]
  outputs = [ "$target_gen_dir/builtins_baseline.cc" ]
  allknown = get_target_outputs(":generate_builtins_all_known")
  args = [
    "--default-configuration",
    rebase_path(sources[0], root_build_dir),
    "--out",
    rebase_path(outputs[0], root_build_dir),
    "--name",
    "BuildBaselineConfig",
    "--all-known",
    rebase_path(allknown[0], root_build_dir),
  ]
  deps = [ ":generate_builtins_all_known" ]
}

action("generate_builtins_all_known_config") {
  script = "builtins_generate_config.py"
  sources = get_target_outputs(":generate_builtins_all_known")
  outputs = [ "$target_gen_dir/builtins_all_known.cc" ]
  args = [
    "--default-configuration",
    rebase_path(sources[0], root_build_dir),
    "--out",
    rebase_path(outputs[0], root_build_dir),
    "--name",
    "BuildAllKnownConfig_ForTesting",
    "--all-known",
    rebase_path(sources[0], root_build_dir),
  ]
  deps = [ ":generate_builtins_all_known" ]
}

# ":generated" is the main target that should be referenced by core/BUILD.gn.
#
# It's down here because GN's get_target_outputs function insists that its
# targets have already been declared.
blink_core_sources("generated") {
  sources = get_target_outputs(":generate_builtins_baseline_config") +
            get_target_outputs(":generate_builtins_default_config")
  deps = [
    ":generate_builtins_baseline_config",
    ":generate_builtins_default_config",
  ]
}

# The "all known" config is large, and is only used at build time, not runtime.
# So we don't want to include it in the binary. But we do want to write some
# tests to sanity check its content, so we have a testonly target for it.
source_set("unit_test_support") {
  testonly = true
  sources = get_target_outputs(":generate_builtins_all_known_config")
  deps = [
    ":generate_builtins_all_known_config",
    "//third_party/blink/renderer/core",
  ]
}