blob: 63cc3c9596b105cd2f58d69022ae11d8935f4f4f [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_cpp_wire",
],
)
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_cpp_wire",
"@fuchsia_sdk//pkg/sys_component_llcpp",
"@fuchsia_sdk//pkg/zx",
],
)
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",
],
)
fuchsia_driver_bytecode_bind_rules(
name = "test_controller_bind_bytecode",
output = "test_controller.bindbc",
rules = "test_i2c_controller.bind",
deps = [
"@fuchsia_sdk//bind/fuchsia.acpi",
],
)
cc_binary(
name = "test_controller",
srcs = [
"constants.h",
"test_i2c_controller.cc",
"test_i2c_controller.h",
],
linkshared = True,
deps = [
"@fuchsia_sdk//fidl/fuchsia.device.fs:fuchsia.device.fs_llcpp_cc",
"@fuchsia_sdk//fidl/fuchsia.driver.compat:fuchsia.driver.compat_llcpp_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_cpp_wire",
"@fuchsia_sdk//pkg/sys_component_llcpp",
"@fuchsia_sdk//pkg/zx",
],
)
fuchsia_component_manifest(
name = "test_controller_manifest",
src = "meta/test_i2c_controller.cml",
)
fuchsia_driver_component(
name = "test_controller_component",
bind_bytecode = ":test_controller_bind_bytecode",
driver_lib = ":test_controller",
manifest = ":test_controller_manifest",
)
fuchsia_package(
name = "test_controller_pkg",
package_name = "test_i2c_controller",
visibility = ["//visibility:public"],
deps = [
":test_controller_component",
],
)