folly/folly/lang/BUCK

load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")

oncall("fbcode_entropy_wardens_folly")

cpp_library(
    name = "access",
    headers = ["Access.h"],
    exported_deps = [
        "//folly/functional:invoke",
    ],
)

cpp_library(
    name = "align",
    headers = ["Align.h"],
    exported_deps = [
        "//folly:portability",
        "//folly:traits",
    ],
)

cpp_library(
    name = "aligned",
    headers = ["Aligned.h"],
    exported_deps = [
        ":align",
        "//folly:utility",
    ],
)

cpp_library(
    name = "assume",
    headers = ["Assume.h"],
    exported_deps = [
        ":hint",
        "//folly:portability",
    ],
)

cpp_library(
    name = "badge",
    headers = ["Badge.h"],
    exported_deps = [
        "//folly:traits",
    ],
)

cpp_library(
    name = "bits",
    headers = ["Bits.h"],
    exported_deps = [
        ":assume",
        ":c_string",
        "//folly:constexpr_math",
        "//folly:portability",
        "//folly:traits",
        "//folly:utility",
        "//folly/portability:builtins",
    ],
)

cpp_library(
    name = "bits_class",
    headers = ["BitsClass.h"],
    exported_deps = [
        "//folly:portability",
        "//folly:range",
        "//folly/lang:bits",
    ],
    exported_external_deps = [
        "glog",
    ],
)

cpp_library(
    name = "builtin",
    headers = ["Builtin.h"],
    exported_deps = [
        "//folly:portability",
    ],
)

cpp_library(
    name = "c_array",
    headers = ["CArray.h"],
)

cpp_library(
    name = "c_string",
    srcs = ["CString.cpp"],
    headers = ["CString.h"],
    deps = [
        "//folly:cpp_attributes",
        "//folly/functional:invoke",
    ],
    exported_deps = [
        "//folly:c_portability",
    ],
)

cpp_library(
    name = "cast",
    headers = ["Cast.h"],
    exported_deps = [
        ":safe_assert",
        "//folly:portability",
        "//folly:traits",
    ],
)

cpp_library(
    name = "checked_math",
    headers = ["CheckedMath.h"],
    exported_deps = [
        "//folly:c_portability",
        "//folly:likely",
    ],
)

cpp_library(
    name = "customization_point",
    headers = ["CustomizationPoint.h"],
    exported_deps = [
        ":static_const",
        "//folly:portability",
    ],
)

cpp_library(
    name = "exception",
    srcs = ["Exception.cpp"],
    headers = ["Exception.h"],
    linker_flags = select({
        "DEFAULT": [],
        "ovr_config//os:macos": ["-lc++abi"],
    }),
    deps = [
        ":new",
    ],
    exported_deps = [
        ":assume",
        ":safe_assert",
        ":thunk",
        ":type_info",
        "//folly:c_portability",
        "//folly:cpp_attributes",
        "//folly:likely",
        "//folly:portability",
        "//folly:traits",
        "//folly:utility",
    ],
)

cpp_library(
    name = "extern",
    headers = ["Extern.h"],
)

cpp_library(
    name = "keep",
    headers = ["Keep.h"],
    exported_deps = [
        "//folly:c_portability",
    ],
)

cpp_library(
    name = "hint",
    headers = [
        "Hint.h",
        "Hint-inl.h",
    ],
    exported_deps = [
        ":safe_assert",
        "//folly:portability",
        "//folly:traits",
    ],
)

cpp_library(
    name = "new",
    headers = ["New.h"],
    exported_deps = [
        "//folly:cpp_attributes",
        "//folly:portability",
        "//folly/functional:invoke",
    ],
)

cpp_library(
    name = "ordering",
    headers = ["Ordering.h"],
    exported_deps = [
        ":exception",
    ],
)

cpp_library(
    name = "propagate_const",
    headers = ["PropagateConst.h"],
    exported_deps = [
        "//folly:traits",
        "//folly:utility",
    ],
)

cpp_library(
    name = "rvalue_reference_wrapper",
    headers = ["RValueReferenceWrapper.h"],
)

cpp_library(
    name = "safe_assert",
    srcs = ["SafeAssert.cpp"],
    headers = ["SafeAssert.h"],
    deps = [
        ":to_ascii",
        "//folly/detail:file_util_detail",
        "//folly/portability:sys_types",
        "//folly/portability:windows",
    ],
    exported_deps = [
        ":c_array",
        "//folly:cpp_attributes",
        "//folly:portability",
        "//folly:preprocessor",
    ],
)

cpp_library(
    name = "static_const",
    headers = ["StaticConst.h"],
    exported_deps = [
        "//folly:portability",
    ],
)

cpp_library(
    name = "thunk",
    headers = ["Thunk.h"],
    exported_deps = [
        ":new",
        "//folly:utility",
    ],
)

cpp_library(
    name = "to_ascii",
    srcs = ["ToAscii.cpp"],
    headers = ["ToAscii.h"],
    exported_deps = [
        ":align",
        ":c_array",
        "//folly:constexpr_math",
        "//folly:likely",
        "//folly:portability",
        "//folly:utility",
        "//folly/portability:builtins",
    ],
)

cpp_library(
    name = "type_info",
    headers = ["TypeInfo.h"],
    exported_deps = [
        "//folly:cpp_attributes",
        "//folly:portability",
    ],
)

cpp_library(
    name = "pretty",
    headers = ["Pretty.h"],
    exported_deps = [
        ":c_array",
        "//folly:portability",
    ],
)

cpp_library(
    name = "uncaught_exceptions",
    srcs = ["UncaughtExceptions.cpp"],
    headers = ["UncaughtExceptions.h"],
    exported_deps = [
        ":exception",
    ],
)