# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/features.gni")

component("cpp") {
  sources = [
    "base_agent.cc",
    "base_agent.h",
    "trace_event_agent.cc",
    "trace_event_agent.h",
    "tracing_features.cc",
    "tracing_features.h",
  ]

  defines = [ "IS_TRACING_CPP_IMPL" ]
  output_name = "tracing_cpp"

  public_deps = [
    "//base",
    "//mojo/public/cpp/bindings",
    "//services/service_manager/public/cpp",
    "//services/tracing/public/mojom",
  ]

  if ((is_mac || is_linux || is_android || is_win) && !use_qt) {
    sources += [
      "perfetto/producer_client.cc",
      "perfetto/producer_client.h",
      "perfetto/shared_memory.cc",
      "perfetto/shared_memory.h",
      "perfetto/task_runner.cc",
      "perfetto/task_runner.h",
      "perfetto/trace_event_data_source.cc",
      "perfetto/trace_event_data_source.h",
    ]

    deps = [
      "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
    ]

    public_deps += [ "//third_party/perfetto:libperfetto" ]
  }
}
