chromium/third_party/blink/renderer/core/inspector/BUILD.gn

# Copyright 2014 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/bindings/bindings.gni")
import("//third_party/blink/renderer/core/core.gni")
import("//third_party/inspector_protocol/inspector_protocol.gni")
import("//v8/gni/v8.gni")

_inspector_protocol_dir = "//third_party/inspector_protocol"

# inspector protocol -----------------------------------------------------------

inspector_protocol_generate("protocol_sources") {
  inspector_protocol_dir = _inspector_protocol_dir
  browser_protocol =
      "//third_party/blink/public/devtools_protocol/browser_protocol.pdl"
  out_dir = blink_core_output_dir

  config_file = "inspector_protocol_config.json"
  _imported = rebase_path(v8_inspector_js_protocol, root_build_dir)
  config_values = [ "imported.path=$_imported" ]

  inputs = [
    v8_inspector_js_protocol,
    browser_protocol,
    "inspector_protocol_config.json",
  ]

  # These are relative to blink_core_output_dir.
  outputs = [
    "inspector/protocol/accessibility.cc",
    "inspector/protocol/accessibility.h",
    "inspector/protocol/animation.cc",
    "inspector/protocol/animation.h",
    "inspector/protocol/audits.cc",
    "inspector/protocol/audits.h",
    "inspector/protocol/cache_storage.cc",
    "inspector/protocol/cache_storage.h",
    "inspector/protocol/css.cc",
    "inspector/protocol/css.h",
    "inspector/protocol/database.cc",
    "inspector/protocol/database.h",
    "inspector/protocol/debugger.h",
    "inspector/protocol/device_orientation.cc",
    "inspector/protocol/device_orientation.h",
    "inspector/protocol/dom.cc",
    "inspector/protocol/dom_debugger.cc",
    "inspector/protocol/dom_debugger.h",
    "inspector/protocol/dom.h",
    "inspector/protocol/dom_snapshot.cc",
    "inspector/protocol/dom_snapshot.h",
    "inspector/protocol/dom_storage.cc",
    "inspector/protocol/dom_storage.h",
    "inspector/protocol/event_breakpoints.cc",
    "inspector/protocol/event_breakpoints.h",
    "inspector/protocol/emulation.cc",
    "inspector/protocol/emulation.h",
    "inspector/protocol/file_system.cc",
    "inspector/protocol/file_system.h",
    "inspector/protocol/forward.h",
    "inspector/protocol/indexed_db.cc",
    "inspector/protocol/indexed_db.h",
    "inspector/protocol/io.cc",
    "inspector/protocol/io.h",
    "inspector/protocol/layer_tree.cc",
    "inspector/protocol/layer_tree.h",
    "inspector/protocol/log.cc",
    "inspector/protocol/log.h",
    "inspector/protocol/media.cc",
    "inspector/protocol/media.h",
    "inspector/protocol/memory.cc",
    "inspector/protocol/memory.h",
    "inspector/protocol/network.cc",
    "inspector/protocol/network.h",
    "inspector/protocol/preload.cc",
    "inspector/protocol/preload.h",
    "inspector/protocol/overlay.cc",
    "inspector/protocol/overlay.h",
    "inspector/protocol/page.cc",
    "inspector/protocol/page.h",
    "inspector/protocol/performance.cc",
    "inspector/protocol/performance.h",
    "inspector/protocol/performance_timeline.cc",
    "inspector/protocol/performance_timeline.h",
    "inspector/protocol/protocol.cc",
    "inspector/protocol/protocol.h",
    "inspector/protocol/runtime.h",
    "inspector/protocol/security.cc",
    "inspector/protocol/security.h",
    "inspector/protocol/storage.cc",
    "inspector/protocol/storage.h",
    "inspector/protocol/web_audio.cc",
    "inspector/protocol/web_audio.h",
  ]

  deps = [ "//third_party/blink/public/devtools_protocol:protocol_version" ]
}

# Compiles the sources generated above.
source_set("generated") {
  sources = get_target_outputs(":protocol_sources")

  configs -= core_config_remove
  configs += core_config_add + [
               "../..:inside_blink",
               "//third_party/blink/renderer/core:core_include_dirs",
             ]

  if (is_win) {
    cflags = [ "/wd4702" ]  # Unreachable code.
  }

  deps = [
    ":protocol_sources",
    "//skia",
    "//third_party/blink/renderer/core:all_generators",
    "//third_party/blink/renderer/core/probe:generated",
    "//third_party/blink/renderer/platform:make_platform_generated",
    "//third_party/blink/renderer/platform/wtf",
    "//v8",
  ]

  public_deps = [
    "//third_party/inspector_protocol:crdtp",
    "//v8:v8_internal_headers",
  ]
}