| # 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/toolchain/toolchain_environment.gni") |
| import("//build/zircon/zx_library.gni") |
| |
| # LINT.IfChange |
| zx_library("fbl") { |
| sdk = "source" |
| sdk_publishable = "internal" |
| sdk_headers = [ |
| "fbl/algorithm.h", |
| "fbl/alloc_checker.h", |
| "fbl/array.h", |
| "fbl/auto_lock.h", |
| "fbl/bits.h", |
| "fbl/conditional_select_nospec.h", |
| "fbl/condition_variable.h", |
| "fbl/confine_array_index.h", |
| "fbl/enum_bits.h", |
| "fbl/hard_int.h", |
| "fbl/inline_array.h", |
| "fbl/intrusive_container_node_utils.h", |
| "fbl/intrusive_container_utils.h", |
| "fbl/intrusive_double_list.h", |
| "fbl/intrusive_hash_table.h", |
| "fbl/intrusive_pointer_traits.h", |
| "fbl/intrusive_single_list.h", |
| "fbl/strong_int.h", |
| "fbl/intrusive_wavl_tree.h", |
| "fbl/intrusive_wavl_tree_internal.h", |
| "fbl/macros.h", |
| "fbl/mutex.h", |
| "fbl/no_destructor.h", |
| "fbl/null_lock.h", |
| "fbl/recycler.h", |
| "fbl/ref_counted.h", |
| "fbl/ref_counted_internal.h", |
| "fbl/ref_counted_upgradeable.h", |
| "fbl/ref_ptr.h", |
| "fbl/ring_buffer.h", |
| "fbl/slab_allocator.h", |
| "fbl/slab_malloc.h", |
| "fbl/static_vector.h", |
| "fbl/string_buffer.h", |
| "fbl/string.h", |
| "fbl/string_printf.h", |
| "fbl/string_traits.h", |
| "fbl/type_info.h", |
| "fbl/unaligned.h", |
| "fbl/unique_fd.h", |
| "fbl/vector.h", |
| "fbl/wavl_tree_best_node_observer.h", |
| ] |
| |
| sources = [ "alloc_checker.cc" ] |
| if (!is_kernel) { |
| sources += [ |
| "string.cc", |
| "string_buffer.cc", |
| "string_printf.cc", |
| ] |
| } |
| |
| public_deps = [ |
| "//sdk/lib/fit", |
| "//sdk/lib/stdcompat", |
| ] |
| |
| deps = [] |
| |
| if (is_kernel) { |
| # Anything using libc++ headers in the kernel needs this. |
| public_deps += [ "//zircon/kernel/lib/ktl:headers" ] |
| if (toolchain_environment == "kernel") { |
| deps += [ "//zircon/kernel/lib/heap:headers" ] |
| } else { |
| deps += [ |
| "//zircon/kernel/lib/ktl", |
| "//zircon/kernel/lib/libc", |
| ] |
| } |
| } |
| |
| if (toolchain_environment == "kernel") { |
| # Avoid circularity. |
| configs -= [ "//zircon/kernel/vm:headers.config" ] |
| } |
| |
| if (!is_fuchsia && !is_kernel) { |
| deps += [ "//zircon/system/public" ] |
| } |
| } |
| |
| # LINT.ThenChange(BUILD.bazel) |
| |
| group("tests") { |
| testonly = true |
| deps = [ "test:tests" ] |
| } |