blob: e9a43feb8a526fe55449f5ee674b7b254f889bf8 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
template("trace_library") {
zx_library(target_name) {
forward_variables_from(invoker, "*")
sdk_headers = [
"lib/trace/internal/event_args.h",
"lib/trace/internal/event_common.h",
"lib/trace/internal/event_internal.h",
"lib/trace/internal/pairs_internal.h",
"lib/trace/internal/string_traits.h",
"lib/trace/event.h",
"lib/trace/event_args.h",
"lib/trace/observer.h",
]
# Header dependencies, not including the trace engine.
# <trace/internal/event_internal.h> has #include <trace-engine/instrumentation.h>.
public_deps += [
# <trace/internal/event_internal.h> has #include <zircon/syscalls.h>.
"$zx/system/ulib/zircon:headers",
# <trace/observer.h> has #include <trace-engine/instrumentation.h> (already
# covered, <lib/async/cpp/wait.h>, <fit/function.h>, and <lib/zx/event.h>.
"$zx/system/ulib/async:async-cpp.headers",
"$zx/system/ulib/fit:headers",
"$zx/system/ulib/zx:headers",
]
sources = [
"event.cc",
"observer.cc",
]
# Source dependencies, not including the trace engine.
deps += [
"$zx/system/ulib/async",
"$zx/system/ulib/async:async-cpp",
"$zx/system/ulib/fit",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zx",
]
}
}
# The default version for the normal case, and for the SDK.
# For the SDK this needs to be published as "source": We're implemented in
# C++ and C++ SDK libraries can't be published as "static".
# TODO(PT-195): libtrace-engine.so is getting linked into places it shouldn't.
trace_library("trace") {
sdk_publishable = true
sdk = "source"
public_deps = [ "$zx/system/ulib/trace-engine:headers" ]
deps = [ "$zx/system/ulib/trace-engine" ]
}
# A special version for programs and shared libraries that can't use
# libtrace-engine.so.
# N.B. Please verify that you really need this before using it.
# Generally you DON'T want to use this.
trace_library("trace-with-static-engine") {
sdk = "static"
public_deps = [ "$zx/system/ulib/trace-engine:trace-engine-static.headers" ]
deps = [ "$zx/system/ulib/trace-engine:trace-engine-static" ]
}
# And again, but this time for drivers.
# This gets linked into each driver.
# TODO(PT-196): Move to ddk.
trace_library("trace-driver") {
sdk = "static"
public_deps = [ "$zx/system/ulib/trace-engine:trace-engine-driver.headers" ]
deps = [ "$zx/system/ulib/trace-engine:trace-engine-driver" ]
}