| # Copyright 2020 The Fuchsia Authors |
| # |
| # Use of this source code is governed by a MIT-style |
| # license that can be found in the LICENSE file or at |
| # https://opensource.org/licenses/MIT |
| |
| import("//build/cpp/library_headers.gni") |
| import("//build/toolchain/toolchain_environment.gni") |
| |
| # Generic parts of acpi_lite. |
| static_library("acpi_lite") { |
| public_deps = [ ":headers" ] |
| |
| complete_static_lib = true |
| |
| sources = [ |
| "acpi_lite.cc", |
| "apic.cc", |
| "debug_port.cc", |
| "numa.cc", |
| "structures.cc", |
| "test_data.cc", |
| ] |
| deps = [ "//zircon/system/ulib/pretty" ] |
| |
| # These bits are needed for both Zircon proper and phys environments. |
| if (is_kernel) { |
| deps += [ |
| "//zircon/kernel/lib/ktl", |
| "//zircon/kernel/lib/libc", |
| ] |
| } |
| } |
| |
| library_headers("headers") { |
| headers = [ |
| "lib/acpi_lite.h", |
| "lib/acpi_lite/numa.h", |
| "lib/acpi_lite/zircon.h", |
| "lib/acpi_lite/apic.h", |
| "lib/acpi_lite/debug_port.h", |
| "lib/acpi_lite/internal.h", |
| "lib/acpi_lite/structures.h", |
| ] |
| public_deps = [ |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| source_set("kernel-tests") { |
| testonly = true |
| } |
| |
| group("phys-tests") { |
| testonly = true |
| } |
| |
| group("boot_tests") { |
| testonly = true |
| } |
| |
| if (!is_kernel) { |
| import("//build/components.gni") |
| import("//build/fuzz.gni") |
| import("//build/test.gni") |
| |
| fuchsia_fuzzer_component("acpi-lite-fuzztest-rust-component") { |
| component_name = "acpi_lite_fuzztest_rust" |
| manifest = "rust/meta/acpi_lite_fuzztest_rust.cml" |
| deps = [ "rust:acpi_lite_fuzztest_rust" ] |
| } |
| |
| fuchsia_fuzzer_component("apic-fuzztest-rust-component") { |
| component_name = "apic_fuzztest_rust" |
| manifest = "rust/meta/apic_fuzztest_rust.cml" |
| deps = [ "rust:apic_fuzztest_rust" ] |
| } |
| |
| fuchsia_fuzzer_component("debug-port-fuzztest-rust-component") { |
| component_name = "debug_port_fuzztest_rust" |
| manifest = "rust/meta/debug_port_fuzztest_rust.cml" |
| deps = [ "rust:debug_port_fuzztest_rust" ] |
| } |
| |
| fuchsia_fuzzer_component("numa-fuzztest-rust-component") { |
| component_name = "numa_fuzztest_rust" |
| manifest = "rust/meta/numa_fuzztest_rust.cml" |
| deps = [ "rust:numa_fuzztest_rust" ] |
| } |
| |
| fuchsia_fuzzer_package("acpi-lite-fuzzer") { |
| rust_fuzzer_components = [ |
| ":acpi-lite-fuzztest-rust-component", |
| ":apic-fuzztest-rust-component", |
| ":debug-port-fuzztest-rust-component", |
| ":numa-fuzztest-rust-component", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":acpi-lite-fuzzer", |
| "rust:acpi_lite_test($host_toolchain)", |
| "rust:tests", |
| ] |
| } |
| } |