| # Copyright 2020 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. |
| |
| import("//build/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| import("//build/test.gni") |
| |
| source_set("metadata") { |
| public = [ "ti-ina231-metadata.h" ] |
| } |
| |
| group("common") { |
| public_deps = [ |
| ":bind", |
| "//sdk/fidl/fuchsia.hardware.power.sensor:fuchsia.hardware.power.sensor_cpp", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| driver_bind_rules("bind") { |
| rules = "ti-ina231.bind" |
| bind_output = "ti-ina231.bindbc" |
| tests = "ti-ina231-bind-test.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_bindlib", |
| "//src/devices/bind/fuchsia.platform", |
| "//src/devices/bind/fuchsia.ti.platform", |
| ] |
| } |
| |
| fuchsia_driver("ti-ina231-driver") { |
| output_name = "ti-ina231" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "ti-ina231.cc" ] |
| deps = [ ":common" ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_driver_component("ti-ina231") { |
| info = "ti-ina231-info.json" |
| component_name = "ti-ina231" |
| deps = [ ":ti-ina231-driver" ] |
| manifest = "meta/ti-ina231.cml" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "ti-ina231" |
| driver_components = [ ":ti-ina231" ] |
| } |
| |
| test("ti-ina231-test-bin") { |
| output_name = "ti-ina231-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "ti-ina231-test.cc", |
| "ti-ina231.cc", |
| ] |
| deps = [ |
| ":common", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_unittest_package("ti-ina231-test") { |
| deps = [ ":ti-ina231-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":bind_test", |
| ":ti-ina231-test", |
| ] |
| } |