| # Copyright 2024 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. | |
| # driver_compat library used by drivers to communicate with DFv1 drivers. | |
| # This library will be removed when DF team can move off this library. | |
| load("//build/bazel/rules/cc:fx_cc_library.bzl", "fx_cc_library") | |
| package(default_applicable_licenses = ["//:license"]) | |
| fx_cc_library( | |
| name = "cpp", | |
| srcs = [ | |
| "banjo_client.cc", | |
| "connect.cc", | |
| "device_server.cc", | |
| "service_offers.cc", | |
| ], | |
| hdrs = [ | |
| "include/lib/driver/compat/cpp/banjo_client.h", | |
| "include/lib/driver/compat/cpp/banjo_server.h", | |
| "include/lib/driver/compat/cpp/compat.h", | |
| "include/lib/driver/compat/cpp/connect.h", | |
| "include/lib/driver/compat/cpp/device_server.h", | |
| "include/lib/driver/compat/cpp/metadata.h", | |
| "include/lib/driver/compat/cpp/service_offers.h", | |
| ], | |
| includes = ["include"], | |
| public_configs = [":includes"], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| visibility = ["//:__subpackages__"], | |
| deps = [ | |
| ":symbols", | |
| "//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp", | |
| "//sdk/lib/driver/async-helpers/cpp", | |
| "//src/devices/bind/fuchsia:fuchsia_cpp", | |
| ] + select({ | |
| "//build/bazel/platforms:is_fuchsia_platform": [ | |
| "//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp", | |
| "//sdk/lib/component/incoming/cpp", | |
| "//sdk/lib/component/outgoing/cpp", | |
| "//sdk/lib/driver/component/cpp", | |
| ], | |
| "//build/bazel/platforms:is_fuchsia_with_sdk_rules": [ | |
| "@fuchsia_sdk//fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp", | |
| "@fuchsia_sdk//pkg/component_incoming_cpp", | |
| "@fuchsia_sdk//pkg/component_outgoing_cpp", | |
| "@fuchsia_sdk//pkg/driver_component_cpp", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| alwayslink = True, | |
| ) | |
| fx_cc_library( | |
| name = "logging", | |
| srcs = ["logging.cc"], | |
| hdrs = ["include/lib/driver/compat/cpp/logging.h"], | |
| includes = ["include"], | |
| public_configs = [":includes"], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| visibility = ["//:__subpackages__"], | |
| deps = select({ | |
| "//build/bazel/platforms:is_fuchsia_platform": [ | |
| "//sdk/lib/driver/logging/cpp", | |
| ], | |
| "//build/bazel/platforms:is_fuchsia_with_sdk_rules": [ | |
| "@fuchsia_sdk//pkg/driver_logging_cpp", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| alwayslink = True, | |
| ) | |
| fx_cc_library( | |
| name = "symbols", | |
| hdrs = ["include/lib/driver/compat/cpp/symbols.h"], | |
| includes = ["include"], | |
| public_configs = [":includes"], | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| visibility = ["//:__subpackages__"], | |
| alwayslink = True, | |
| ) |