| # Copyright 2022 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. |
| |
| load( |
| "@rules_fuchsia//fuchsia:defs.bzl", |
| "fuchsia_component_manifest", |
| "fuchsia_driver_bind_bytecode", |
| "fuchsia_driver_component", |
| "fuchsia_package", |
| ) |
| |
| # [START bind_rules] |
| fuchsia_driver_bind_bytecode( |
| name = "bind_bytecode", |
| output = "i2c_controller.bindbc", |
| rules = "i2c_controller.bind", |
| deps = [ |
| "//src/testing/lib:examples.driver.test", |
| ], |
| ) |
| # [END bind_rules] |
| |
| # [START cc_binary] |
| cc_binary( |
| name = "i2c_controller", |
| srcs = [ |
| "i2c_controller.cc", |
| "i2c_controller.h", |
| "i2c_server.cc", |
| "i2c_server.h", |
| ], |
| linkshared = True, |
| deps = [ |
| "//src/i2c_temperature/lib", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_bindlib_cc", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_llcpp_cc", |
| "@fuchsia_sdk//pkg/driver_compat", |
| "@fuchsia_sdk//pkg/driver_component_cpp", |
| ], |
| ) |
| # [END cc_binary] |
| |
| fuchsia_component_manifest( |
| name = "manifest", |
| src = "meta/i2c_controller.cml", |
| includes = [ |
| "@fuchsia_sdk//pkg/syslog:client", |
| ], |
| ) |
| |
| fuchsia_driver_component( |
| name = "component", |
| bind_bytecode = ":bind_bytecode", |
| driver_lib = ":i2c_controller", |
| manifest = ":manifest", |
| ) |
| |
| fuchsia_package( |
| name = "pkg", |
| package_name = "i2c_controller", |
| visibility = ["//visibility:public"], |
| components = [ |
| ":component" |
| ], |
| ) |