BUILD.gn 4.3 KB
Newer Older
1 2 3 4
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

5 6
import("../../gni/v8.gni")

7
_inspector_protocol = v8_path_prefix + "/third_party/inspector_protocol"
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
import("$_inspector_protocol/inspector_protocol.gni")

_protocol_generated = [
  "protocol/Forward.h",
  "protocol/Protocol.cpp",
  "protocol/Protocol.h",
  "protocol/Console.cpp",
  "protocol/Console.h",
  "protocol/Debugger.cpp",
  "protocol/Debugger.h",
  "protocol/HeapProfiler.cpp",
  "protocol/HeapProfiler.h",
  "protocol/Profiler.cpp",
  "protocol/Profiler.h",
  "protocol/Runtime.cpp",
  "protocol/Runtime.h",
  "protocol/Schema.cpp",
  "protocol/Schema.h",
  "../../include/inspector/Debugger.h",
  "../../include/inspector/Runtime.h",
  "../../include/inspector/Schema.h",
29 30
]

31
action("protocol_compatibility") {
32
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
33
  script = "$_inspector_protocol/check_protocol_compatibility.py"
34
  inputs = [ v8_inspector_js_protocol ]
35
  _stamp = "$target_gen_dir/js_protocol.stamp"
36
  outputs = [ _stamp ]
37
  args = [
38 39
    "--stamp",
    rebase_path(_stamp, root_build_dir),
40
    rebase_path(v8_inspector_js_protocol, root_build_dir),
41 42 43
  ]
}

44 45
inspector_protocol_generate("protocol_generated_sources") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
46
  deps = [ ":protocol_compatibility" ]
47

48
  inspector_protocol_dir = _inspector_protocol
49
  out_dir = target_gen_dir
50 51
  _protocol_path = rebase_path(v8_inspector_js_protocol, root_build_dir)
  config_values = [ "protocol.path=$_protocol_path" ]
52
  config_file = v8_path_prefix + "/src/inspector/inspector_protocol_config.json"
53
  inputs = [
54 55
    v8_inspector_js_protocol,
    config_file,
56 57 58 59
  ]
  outputs = _protocol_generated
}

60 61 62 63 64
config("inspector_config") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  configs = [ "../../:internal_config" ]
  include_dirs = [ "../../include" ]
65 66
}

67 68 69 70 71 72
v8_header_set("inspector_test_headers") {
  configs = [ ":inspector_config" ]

  public_deps = [ "../..:v8_headers" ]

  sources = [ "test-interface.h" ]
73 74
}

75 76 77 78 79 80
v8_source_set("inspector_string_conversions") {
  sources = [
    "v8-string-conversions.cc",
    "v8-string-conversions.h",
  ]
  configs = [ "../..:internal_config_base" ]
81
  deps = [ "../..:v8_libbase" ]
82 83
}

84
v8_source_set("inspector") {
85
  deps = [
86
    ":inspector_string_conversions",
87
    "../..:v8_tracing",
88
    "../..:v8_version",
89
    "../../third_party/inspector_protocol:crdtp",
90 91 92
  ]

  public_deps = [
93
    ":inspector_test_headers",
94
    ":protocol_generated_sources",
95
    "../../:v8_libbase",
96
  ]
97

98
  configs = [ ":inspector_config" ]
99

100 101 102 103 104 105
  sources = rebase_path(_protocol_generated, ".", target_gen_dir)
  sources += [
    "../../include/v8-inspector-protocol.h",
    "../../include/v8-inspector.h",
  ]
  sources += [
106 107
    "custom-preview.cc",
    "custom-preview.h",
108 109 110 111 112 113 114 115 116 117 118 119
    "injected-script.cc",
    "injected-script.h",
    "inspected-context.cc",
    "inspected-context.h",
    "remote-object-id.cc",
    "remote-object-id.h",
    "search-util.cc",
    "search-util.h",
    "string-16.cc",
    "string-16.h",
    "string-util.cc",
    "string-util.h",
120
    "test-interface.cc",
121 122 123 124 125 126 127 128
    "v8-console-agent-impl.cc",
    "v8-console-agent-impl.h",
    "v8-console-message.cc",
    "v8-console-message.h",
    "v8-console.cc",
    "v8-console.h",
    "v8-debugger-agent-impl.cc",
    "v8-debugger-agent-impl.h",
129 130
    "v8-debugger-id.cc",
    "v8-debugger-id.h",
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
    "v8-debugger-script.cc",
    "v8-debugger-script.h",
    "v8-debugger.cc",
    "v8-debugger.h",
    "v8-heap-profiler-agent-impl.cc",
    "v8-heap-profiler-agent-impl.h",
    "v8-inspector-impl.cc",
    "v8-inspector-impl.h",
    "v8-inspector-session-impl.cc",
    "v8-inspector-session-impl.h",
    "v8-profiler-agent-impl.cc",
    "v8-profiler-agent-impl.h",
    "v8-regex.cc",
    "v8-regex.h",
    "v8-runtime-agent-impl.cc",
    "v8-runtime-agent-impl.h",
    "v8-schema-agent-impl.cc",
    "v8-schema-agent-impl.h",
    "v8-stack-trace-impl.cc",
    "v8-stack-trace-impl.h",
151 152
    "v8-value-utils.cc",
    "v8-value-utils.h",
153 154
    "v8-webdriver-serializer.cc",
    "v8-webdriver-serializer.h",
155 156
    "value-mirror.cc",
    "value-mirror.h",
157 158
  ]
}
159 160 161 162 163

#Target to generate all .cc files.
group("v8_generated_cc_files") {
  testonly = true

164
  deps = [ ":protocol_generated_sources" ]
165
}