| # 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") |
| |
| # TODO(fxbug.dev/13096): Add ddk support. |
| |
| # This special config allows "common" to locate the library's headers. |
| # Not relying on the "headers" target generated by the library below |
| # allows this file to be reused in the Fuchsia GN build. |
| config("library_headers_config") { |
| visibility = [ ":*" ] |
| |
| include_dirs = [ |
| "include", |
| "../trace/include", |
| "../trace-engine/include", |
| ] |
| } |
| |
| # The default version for the normal case. |
| zx_library("trace-vthread") { |
| sdk = "static" |
| sdk_headers = [ |
| "trace-vthread/internal/event_vthread.h", |
| "trace-vthread/event_vthread.h", |
| ] |
| sources = [ "event_vthread.cc" ] |
| public_deps = [ |
| # <trace-vthread/internal/event_vthread.h> has #include <lib/trace/event_args.h>. |
| "//zircon/system/ulib/trace", |
| |
| # <trace-vthread/internal/event_vthread.h> has #include <trace-engine/instrumentation.h>. |
| "//zircon/system/ulib/trace-engine", |
| ] |
| deps = [ "//zircon/system/ulib/trace" ] |
| public = [ "include/trace-vthread/event_vthread.h" ] |
| public_configs = [ ":library_headers_config" ] |
| } |
| |
| # 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. |
| zx_library("trace-vthread-with-static-engine") { |
| sdk = "static" |
| sdk_headers = [ |
| "trace-vthread/internal/event_vthread.h", |
| "trace-vthread/event_vthread.h", |
| ] |
| sources = [ "event_vthread.cc" ] |
| public_deps = [ |
| # <trace-vthread/internal/event_vthread.h> has #include <lib/trace/event_args.h>. |
| "//zircon/system/ulib/trace:trace-with-static-engine", |
| |
| # <trace-vthread/internal/event_vthread.h> has #include <trace-engine/instrumentation.h>. |
| "//zircon/system/ulib/trace-engine:trace-engine-static", |
| ] |
| deps = [ "//zircon/system/ulib/trace:trace-with-static-engine" ] |
| public = [ "include/trace-vthread/event_vthread.h" ] |
| public_configs = [ ":library_headers_config" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ "test:tests" ] |
| } |