# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/src/tracing/tracing_args.gni")

buildconfig_header("tracing_buildconfig") {
  header = "build_config.h"
  header_dir = "matter/tracing"

  # When neither none nor multiplexed is set, expect a separate config
  #  to be set, that provides matter/tracing/macros_impl.h

  defines = [ "MATTER_TRACING_ENABLED=${matter_enable_tracing_support}" ]
}

config("multiplexed_tracing") {
  include_dirs = [ "multiplexed/include" ]
}

static_library("tracing") {
  sources = [
    "backend.h",
    "log_declares.h",
    "registry.cpp",
    "registry.h",
  ]

  public_deps = [
    ":tracing_buildconfig",
    "${chip_root}/src/lib/support",
  ]
}

source_set("macros") {
  sources = [ "macros.h" ]

  public_deps = [
    ":tracing",
    ":tracing_buildconfig",
  ]

  if (matter_enable_tracing_support) {
    public_deps += [ matter_trace_config ]
  }
}
