| # Copyright 2021 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/test.gni") |
| import("//build/zircon/migrated_targets.gni") |
| |
| zx_library("page-table") { |
| sdk = "source" |
| sdk_migrated = true |
| |
| host = true |
| kernel = true |
| static = true |
| |
| sources = [ |
| "arch/x86/builder.cc", |
| "arch/x86/lookup.cc", |
| "arch/x86/mmu.cc", |
| ] |
| |
| include_dirs = [ |
| ".", |
| "include", |
| ] |
| |
| deps = [ |
| "//src/zircon/lib/zircon", |
| "//zircon/kernel/lib/arch", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hwreg", |
| ] |
| if (is_kernel) { |
| deps += [ "//zircon/kernel/lib/libc" ] |
| } |
| |
| public_deps = [ |
| # <page-table/page-table.h> has #include <zircon/types.h>. |
| "//src/zircon/lib/zircon:headers", |
| |
| # <page-table/types.h> has #include <fbl/strong_int.h>. |
| "//zircon/system/ulib/fbl:headers", |
| |
| # <page-table/arch/x86/builder.h> has #include <lib/arch/x86/cpuid.h>. |
| "//zircon/kernel/lib/arch:headers", |
| ] |
| } |
| |
| test("page-table-test") { |
| include_dirs = [ "." ] |
| sources = [ |
| "arch/x86/builder_test.cc", |
| "arch/x86/lookup_test.cc", |
| "arch/x86/mmu_test.cc", |
| ] |
| deps = [ |
| ":page-table", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/kernel/lib/arch", |
| "//zircon/kernel/lib/arch/testing", |
| "//zircon/system/ulib/hwreg", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":page-table", |
| ":page-table-test($host_toolchain)", |
| ] |
| } |