| # 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/components.gni") |
| import("//build/test.gni") |
| import("//build/zircon/migrated_targets.gni") |
| |
| zx_library("memalloc") { |
| sdk = "source" |
| sdk_headers = [ "lib/memalloc.h" ] |
| sdk_migrated = true |
| |
| host = true |
| kernel = true |
| static = true |
| |
| sources = [ "allocator.cc" ] |
| |
| deps = [ |
| "//src/zircon/lib/zircon", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zxc", |
| ] |
| if (is_kernel) { |
| deps += [ "//zircon/kernel/lib/libc" ] |
| } |
| |
| public_deps = [ |
| # <lib/memalloc.h> has #include <fbl/algorithm.h>. |
| "//zircon/system/ulib/fbl:headers", |
| |
| # <lib/memalloc.h> has #include <zx/status.h>. |
| "//src/zircon/lib/zircon:headers", |
| |
| # <lib/memalloc.h> has #include <lib/zx/status.h>. |
| "//zircon/system/ulib/zxc:headers", |
| ] |
| } |
| |
| test("memalloc-test") { |
| sources = [ "allocator_test.cc" ] |
| deps = [ |
| ":memalloc", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("memalloc-test-package") { |
| package_name = "memalloc-tests" |
| deps = [ ":memalloc-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":memalloc-test($host_toolchain)", |
| ":memalloc-test-package", |
| ] |
| } |