blob: 75ae20f072944c0d34e54e5a2c9b2922ef4ff339 [file] [log] [blame]
# 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_cc_binary",
"fuchsia_component_manifest",
"fuchsia_driver_bytecode_bind_rules",
"fuchsia_driver_component",
"fuchsia_fidl_library",
"fuchsia_fidl_llcpp_library",
"fuchsia_package",
)
fuchsia_fidl_library(
name = "sample.i2ctemperature",
srcs = [
"i2c_temperature.fidl",
],
library = "sample.i2ctemperature",
visibility = ["//visibility:public"],
deps = [
"@fuchsia_sdk//fidl/zx:zx",
],
)
fuchsia_fidl_llcpp_library(
name = "sample.i2ctemperature_cc",
library = ":sample.i2ctemperature",
visibility = ["//visibility:public"],
deps = [
"@fuchsia_sdk//fidl/zx:zx_llcpp_cc",
"@fuchsia_sdk//pkg/fidl-llcpp-experimental-driver-only",
],
)
fuchsia_driver_bytecode_bind_rules(
name = "bind_bytecode",
output = "i2c_temperature.bindbc",
rules = "i2c_temperature.bind",
deps = [
"@fuchsia_sdk//bind/fuchsia.i2c",
],
)
cc_binary(
name = "i2c_temperature",
srcs = [
"constants.h",
"i2c_channel.cc",
"i2c_channel.h",
"i2c_temperature.cc",
"i2c_temperature.h",
],
linkshared = True,
deps = [
":sample.i2ctemperature_cc",
"@fuchsia_sdk//fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_llcpp_cc",
"@fuchsia_sdk//fidl/zx:zx_cc",
"@fuchsia_sdk//pkg/async-cpp",
"@fuchsia_sdk//pkg/driver2-llcpp",
"@fuchsia_sdk//pkg/fidl-llcpp-experimental-driver-only",
"@fuchsia_sdk//pkg/sys_component_llcpp",
"@fuchsia_sdk//pkg/zx-experimental-driver-only",
],
)
fuchsia_component_manifest(
name = "manifest",
src = "meta/i2c_temperature.cml",
)
fuchsia_driver_component(
name = "component",
bind_bytecode = ":bind_bytecode",
driver_lib = ":i2c_temperature",
manifest = ":manifest",
)
fuchsia_package(
name = "pkg",
package_name = "i2c_temperature",
visibility = ["//visibility:public"],
deps = [
":component",
],
)