| # 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") |
| |
| driver_bind_rules("shtv3-bind") { |
| rules = "shtv3.bind" |
| header_output = "shtv3-bind.h" |
| tests = "shtv3-bind-test.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.i2c", |
| "//src/devices/bind/fuchsia.misc", |
| "//src/devices/bind/fuchsia.sensirion.platform", |
| ] |
| } |
| |
| source_set("common") { |
| public_deps = [ |
| ":shtv3-bind", |
| "//sdk/fidl/fuchsia.hardware.temperature:fuchsia.hardware.temperature_llcpp", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/zxc", |
| ] |
| } |
| |
| fuchsia_driver("shtv3-driver") { |
| output_name = "shtv3" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "shtv3.cc" ] |
| deps = [ ":common" ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_driver_component("shtv3") { |
| info = "shtv3-info.json" |
| component_name = "shtv3" |
| deps = [ ":shtv3-driver" ] |
| colocate = true |
| } |
| |
| test("shtv3-test-bin") { |
| output_name = "shtv3-test" |
| sources = [ |
| "shtv3-test.cc", |
| "shtv3.cc", |
| ] |
| deps = [ |
| ":common", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_unittest_package("shtv3-test") { |
| deps = [ ":shtv3-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":shtv3-bind_test", |
| ":shtv3-test", |
| ] |
| } |