blob: d10038d113872f9e9b8f0b2482db951d12c64644 [file] [log] [blame]
# Copyright 2018 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.
import("//build/package.gni")
gperftools_src_root = "//third_party/gperftools/src/"
if (!is_debug) {
cflags_cc = [ "-DNO_FRAME_POINTER" ]
}
config("headers_config") {
include_dirs = [
"fuchsia",
gperftools_src_root,
"include",
]
}
source_set("profiler_headers") {
public_configs = [ ":headers_config" ]
}
source_set("profiler_lib") {
public_configs = [ ":headers_config" ]
gperftools_sources = [
"gperftools/profiler.h",
"profile-handler.h",
"getpc.h",
"base/basictypes.h",
"base/commandlineflags.h",
"base/googleinit.h",
"base/logging.h",
"base/simple_mutex.h",
"base/sysinfo.h",
"profiledata.cc",
"profiler.cc",
"gperftools/stacktrace.h",
"stacktrace.cc",
"stacktrace_libunwind-inl.h",
"emergency_malloc_for_stacktrace.cc",
"profile-handler.cc",
"base/spinlock.cc",
"base/spinlock_internal.cc",
"base/sysinfo.cc",
"base/logging.cc",
]
additional_sources = [
"fuchsia/profiler_log_listener.h",
"fuchsia/profiler_log_listener.cc",
"fuchsia/thread_interrupter.cc",
"fuchsia/thread_interrupter.h",
]
sources = rebase_path(gperftools_sources, ".", gperftools_src_root) +
additional_sources
deps = [
":profiler_headers",
"//garnet/public/lib/component/cpp",
"//garnet/public/lib/fsl",
"//garnet/public/lib/fxl",
"//zircon/public/fidl/fuchsia-logger",
"//zircon/public/lib/async-loop-cpp",
]
}
static_library("profiler_static") {
public_deps = [
":profiler_lib",
]
}
shared_library("profiler") {
public_deps = [
":profiler_lib",
]
}