| # Copyright 2023 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_driver", | |
| "fuchsia_cc_test", | |
| "fuchsia_component_manifest", | |
| "fuchsia_driver_bind_bytecode", | |
| "fuchsia_driver_component", | |
| "fuchsia_package", | |
| "fuchsia_platforms", | |
| "fuchsia_unittest_package", | |
| ) | |
| load( | |
| "@rules_fuchsia//fuchsia:licenses.bzl", | |
| "fuchsia_licenses_collection", | |
| "fuchsia_licenses_spdx", | |
| ) | |
| package( | |
| default_applicable_licenses = ["//:license_fuchsia"], | |
| default_visibility = ["//visibility:public"], | |
| ) | |
| FUCHSIA_API_LEVEL = "HEAD" | |
| exports_files(["README.fuchsia"]) | |
| fuchsia_driver_bind_bytecode( | |
| name = "bind_bytecode", | |
| output = "pcf8563.bindbc", | |
| rules = "pcf8563.bind", | |
| deps = ["@fuchsia_sdk//bind/fuchsia.nxp.platform"], | |
| ) | |
| cc_library( | |
| name = "common", | |
| srcs = [ | |
| "pcf8563.cc", | |
| "pcf8563-server.cc", | |
| "pcf8563-server.h", | |
| ], | |
| hdrs = ["pcf8563.h"], | |
| deps = [ | |
| "@fuchsia_sdk//fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_cpp", | |
| "@fuchsia_sdk//fidl/fuchsia.hardware.rtc:fuchsia.hardware.rtc_cpp", | |
| "@fuchsia_sdk//pkg/driver_component_cpp", | |
| "@fuchsia_sdk//pkg/driver_devfs_cpp", | |
| "@fuchsia_sdk//pkg/driver_logging_cpp", | |
| "@fuchsia_sdk//pkg/driver_runtime", # <--? | |
| "@fuchsia_sdk//pkg/fit", | |
| "@fuchsia_sdk//pkg/zx", | |
| ], | |
| ) | |
| fuchsia_cc_driver( | |
| name = "driver", | |
| deps = [":common"], | |
| ) | |
| fuchsia_component_manifest( | |
| name = "manifest", | |
| src = "meta/pcf8563.cml", | |
| ) | |
| fuchsia_driver_component( | |
| name = "component", | |
| bind_bytecode = ":bind_bytecode", | |
| driver_lib = ":driver", | |
| manifest = ":manifest", | |
| ) | |
| fuchsia_package( | |
| name = "pkg", | |
| package_name = "pcf8563", | |
| components = [":component"], | |
| fuchsia_api_level = FUCHSIA_API_LEVEL, | |
| platform = fuchsia_platforms.arm64, | |
| visibility = ["//visibility:public"], | |
| ) | |
| fuchsia_cc_test( | |
| name = "pcf8563_test", | |
| size = "small", | |
| srcs = ["pcf8563-test.cc"], | |
| deps = [ | |
| ":common", | |
| "@com_google_googletest//:gtest_main", | |
| "@fuchsia_sdk//fidl/fuchsia.io:fuchsia.io_cpp", | |
| "@fuchsia_sdk//pkg/async_patterns_testing_cpp", | |
| "@fuchsia_sdk//pkg/driver_runtime_cpp", | |
| "@fuchsia_sdk//pkg/driver_testing_cpp", | |
| "@fuchsia_sdk//pkg/fdio", | |
| ], | |
| ) | |
| fuchsia_unittest_package( | |
| name = "test_x64", | |
| package_name = "pcf8563_test", | |
| fuchsia_api_level = FUCHSIA_API_LEVEL, | |
| platform = fuchsia_platforms.x64, | |
| unit_tests = [":pcf8563_test"], | |
| visibility = ["//visibility:public"], | |
| ) | |
| fuchsia_unittest_package( | |
| name = "test_arm64", | |
| package_name = "pcf8563_test", | |
| fuchsia_api_level = FUCHSIA_API_LEVEL, | |
| platform = fuchsia_platforms.arm64, | |
| unit_tests = [":pcf8563_test"], | |
| visibility = ["//visibility:public"], | |
| ) | |
| fuchsia_licenses_collection( | |
| name = "pcf8563_pkg_licenses_collection", | |
| root_target = ":pkg", | |
| ) | |
| fuchsia_licenses_spdx( | |
| name = "pcf8563_licenses.spdx.json", | |
| document_namespace = "https://fuchsia.googlesource.com/drivers/rtc/nxp/pcf8563/", | |
| licenses = ":pcf8563_pkg_licenses_collection", | |
| licenses_cross_refs_base_url = "https://fuchsia.googlesource.com/drivers/rtc/nxp/pcf8563/+/refs/heads/main/", | |
| root_package_homepage = "https://fuchsia.googlesource.com/drivers/rtc/nxp/pcf8563/", | |
| root_package_name = "pcf8563", | |
| ) |