blob: 0c0cc3f28993d54d5c2662d1499107f1ea1035fb [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.
import("//build/unification/zx_library.gni")
syslog_headers = [
"lib/syslog/global.h",
"lib/syslog/logger.h",
"lib/syslog/wire_format.h",
]
zx_library("syslog") {
sdk = "shared"
sdk_publishable = true
sdk_headers = syslog_headers
shared = true
sources = [
"fdio_connect.cc",
"fx_logger.cc",
"global.cc",
"legacy.cc",
"logger.cc",
]
deps = [
":helpers",
"//sdk/fidl/fuchsia.logger:fuchsia.logger_llcpp",
"//sdk/lib/diagnostics/syslog:client_includes",
"//sdk/lib/fdio",
"//sdk/lib/syslog/cpp:cpp-macros",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/zx",
]
runtime_deps = [ "//sdk/lib/fdio:fdio_sdk" ]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
zx_library("syslog-compat") {
sdk = "shared"
sdk_publishable = true
sdk_headers = syslog_headers
shared = true
sources = [
"compat.cc",
"fdio_connect.cc",
"fx_logger.cc",
"global.cc",
"logger.cc",
]
deps = [
":helpers",
"//sdk/fidl/fuchsia.logger:fuchsia.logger_llcpp",
"//sdk/lib/diagnostics/syslog:client_includes",
"//sdk/lib/fdio",
"//sdk/lib/syslog/cpp:backend_fuchsia_compat",
"//sdk/lib/syslog/cpp:cpp-macros",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/zx",
]
runtime_deps = [ "//sdk/lib/fdio:fdio_sdk" ]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
# This static library should have no shared library dependencies,
# except libzircon, so it may be used from magma client driver libraries
# such as the Vulkan ICD.
# This library cannot connect to the logging service, so a console_fd
# or log_service_channel must be provided at initialization.
zx_library("syslog-static") {
sdk = "static"
sdk_headers = syslog_headers
sources = [
"fx_logger.cc",
"global.cc",
"logger.cc",
]
deps = [
":helpers",
"//sdk/lib/diagnostics/syslog:client_includes",
"//zircon/public/lib/fbl",
"//zircon/public/lib/zx",
]
defines = [ "SYSLOG_STATIC" ]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
zx_library("syslog-headers") {
sdk = "static"
sdk_publishable = true
sdk_headers = syslog_headers
}
source_set("helpers") {
sources = [
"helpers.cc",
"helpers.h",
]
deps = [ ":syslog-headers" ]
}