blob: c124c4f16dbc1a906f3b31fa0d2158a468cfda69 [file] [log] [blame]
# 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")
library_headers("headers") {
headers = []
# <ktl/bit.h> has #include <lib/stdcompat/bit.h>.
if (is_kernel) {
public_deps = [ "//sdk/lib/stdcompat:headers" ]
} else {
public_deps = [ "//sdk/lib/stdcompat" ]
}
# ktl headers come before libc++ headers so they can override a few. But
# some libc++ headers use #include_next, so we need another directory that
# comes after the libc++ headers where ktl can provide the headers libc++
# expects to come from libc.
public_configs = [ ":headers.after" ]
}
config("headers.after") {
visibility = [ ":*" ]
cflags = [
"-idirafter",
rebase_path("include-after", root_build_dir),
]
}
static_library("ktl") {
public_deps = [ ":headers" ]
if (is_kernel) {
sources = [
"align.cc",
"popcount.cc",
"stub-new.cc",
]
deps = [
":headers", # Necessary to put ktl includes before libc.
"//sdk/lib/stdcompat:headers",
"//zircon/kernel/lib/libc:headers",
]
}
}