| # 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. |
| |
| ########################################## |
| # Though under //zircon, this build file # |
| # is meant to be used in the Fuchsia GN # |
| # build. # |
| # See fxbug.dev/36548. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/unification/zx_library.gni") |
| |
| 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>. |
| |
| # <trace/observer.h> has #include <trace-engine/instrumentation.h> (already |
| # covered, <lib/async/cpp/wait.h>, <fit/function.h>, and <lib/zx/event.h>. |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zx", |
| ] |
| |
| sources = [ |
| "event.cc", |
| "observer.cc", |
| ] |
| |
| # Source dependencies, not including the trace engine. |
| deps += [ |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| } |
| |
| set_defaults("trace_library") { |
| configs = default_common_binary_configs |
| } |
| |
| # 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(fxbug.dev/23056): libtrace-engine.so is getting linked into places it shouldn't. |
| trace_library("trace") { |
| sdk_publishable = true |
| sdk = "source" |
| public_deps = [ "//zircon/system/ulib/trace-engine" ] |
| deps = [ "//zircon/system/ulib/trace-engine" ] |
| configs += [ |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| "//build/config:Wno-conversion", |
| ] |
| } |
| |
| # 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 = [ "//zircon/system/ulib/trace-engine:trace-engine-static" ] |
| deps = [ "//zircon/system/ulib/trace-engine:trace-engine-static" ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| # And again, but this time for drivers. |
| # This gets linked into each driver. |
| # TODO(fxbug.dev/23057): Move to ddk. |
| trace_library("trace-driver") { |
| sdk = "static" |
| public_deps = [ "//zircon/system/ulib/trace-engine:trace-engine-driver" ] |
| deps = [ "//zircon/system/ulib/trace-engine:trace-engine-driver" ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |