| # Copyright 2019 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/cpp/library_headers.gni") |
| import("//build/cpp/sdk_source_set.gni") |
| import("//build/toolchain/toolchain_environment.gni") |
| |
| library_headers("headers") { |
| headers = [ |
| "hwreg/asm.h", |
| "hwreg/bitfields.h", |
| "hwreg/indirect.h", |
| "hwreg/internal.h", |
| "hwreg/mmio.h", |
| "hwreg/pio.h", |
| ] |
| |
| public_deps = [ |
| # <hwreg/mmio.h> has #include <lib/mmio-ptr/mmio-ptr.h>. |
| "//zircon/system/ulib/mmio-ptr", |
| |
| # <hwreg/array.h> has #include <lib/stdcompat/span.h>. |
| "//sdk/lib/stdcompat", |
| ] |
| |
| # TODO(mcgrathr): remove old multiboot environment |
| if (is_kernel && toolchain_environment != "multiboot") { |
| public_deps += [ |
| "//zircon/kernel/lib/ktl:headers", |
| "//zircon/kernel/lib/libc:headers", |
| ] |
| } |
| } |
| |
| source_set("hwreg") { |
| public_deps = [ ":headers" ] |
| |
| sources = [ "printers.cc" ] |
| if (!is_kernel) { |
| sources += [ "asm.cc" ] |
| deps = [ "//sdk/lib/fit" ] |
| } |
| } |
| |
| library_headers("hwreg-mock.headers") { |
| headers = [ "hwreg/mock.h" ] |
| public_deps = [ |
| ":headers", |
| |
| # <hwreg/mock.h> has #include <lib/mock-function/mock-function.h>. |
| "//zircon/system/ulib/mock-function:headers", |
| ] |
| } |
| |
| source_set("hwreg-mock") { |
| testonly = true |
| public_deps = [ ":hwreg-mock.headers" ] |
| deps = [ "//zircon/system/ulib/mock-function" ] |
| } |
| |
| # Subset of API exported via the SDK. |
| sdk_source_set("hwreg_sdk") { |
| category = "partner" |
| sdk_name = "hwreg" |
| stable = true |
| |
| include_dirs = [ "include" ] |
| |
| public_deps = [ |
| # <hwreg/mmio.h> has #include <lib/mmio-ptr/mmio-ptr.h>. |
| "//zircon/system/ulib/mmio-ptr", |
| |
| # <hwreg/internal.h> has #include <lib/stdcompat/atomic.h>. |
| "//sdk/lib/stdcompat", |
| ] |
| |
| sources = [ |
| "include/hwreg/bitfields.h", |
| "include/hwreg/internal.h", |
| "include/hwreg/mmio.h", |
| "printers.cc", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ "test:tests" ] |
| } |