blob: dc91084e1fbb340f9866fb2bd44d1d9a868a32db [file] [log] [blame]
# 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/sdk_source_set.gni")
import("//build/toolchain/toolchain_environment.gni")
import("//build/zircon/zx_library.gni")
zx_library("hwreg") {
sdk = "source"
sdk_headers = [
"hwreg/asm.h",
"hwreg/bitfields.h",
"hwreg/indirect.h",
"hwreg/internal.h",
"hwreg/mmio.h",
"hwreg/pio.h",
]
sources = [ "printers.cc" ]
if (is_kernel) {
# TODO(mcgrathr): remove old multiboot environment
if (toolchain_environment != "multiboot") {
public_deps = [
"//zircon/kernel/lib/ktl:headers",
"//zircon/kernel/lib/libc:headers",
]
}
} else {
sources += [ "asm.cc" ]
deps = [ "//sdk/lib/fit" ]
}
}
zx_library("hwreg-mock") {
testonly = true
sdk = "source"
sdk_headers = [
"hwreg/asm.h",
"hwreg/bitfields.h",
"hwreg/indirect.h",
"hwreg/internal.h",
"hwreg/mmio.h",
"hwreg/mock.h",
"hwreg/pio.h",
]
sources = []
deps = [ "//zircon/system/ulib/mock-function" ]
public_deps = [
# <hwreg/mock.h> has #include <lib/mock-function/mock-function.h>.
"//zircon/system/ulib/mock-function:headers",
]
}
# Subset of API exported via the SDK.
sdk_source_set("hwreg_sdk") {
category = "experimental"
sdk_name = "hwreg"
include_dirs = [ "include" ]
sources = [
"include/hwreg/bitfields.h",
"include/hwreg/internal.h",
"include/hwreg/mmio.h",
"printers.cc",
]
}
group("tests") {
testonly = true
deps = [ "test:tests" ]
}