blob: 425e289b8062597267b5e80f125abc4681808f6c [file]
# 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("$zx_build/public/gn/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 = [
"$zx/system/ulib/fbl",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zxc",
]
if (is_kernel) {
deps += [ "$zx/kernel/lib/libc" ]
}
public_deps = [
# <lib/memalloc.h> has #include <fbl/algorithm.h>.
"$zx/system/ulib/fbl:headers",
# <lib/memalloc.h> has #include <zx/status.h>.
"$zx/system/ulib/zircon:headers",
# <lib/memalloc.h> has #include <lib/zx/status.h>.
"$zx/system/ulib/zxc:headers",
]
}
# Fuchsia build only.
if (zx != "/") {
import("//build/test.gni")
import("//build/test/test_package.gni")
test("memalloc-test") {
sources = [ "allocator_test.cc" ]
deps = [
":memalloc",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
test_package("memalloc-test-package") {
package_name = "memalloc-tests"
deps = [ ":memalloc-test" ]
tests = [
{
name = "memalloc-test"
},
]
}
group("tests") {
testonly = true
deps = [
":memalloc-test($host_toolchain)",
":memalloc-test-package",
]
}
}