load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("../../defs.bzl", "folly_xplat_cxx_library")

oncall("fbcode_entropy_wardens_folly")

non_fbcode_target(
    _kind = folly_xplat_cxx_library,
    name = "immortal_exception_storage",
    raw_headers = ["immortal_exception_storage.h"],
    exported_deps = [
        "//xplat/folly/lang:exception",
        "//xplat/folly/result:rich_error_fwd",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "immortal_exception_storage",
    headers = ["immortal_exception_storage.h"],
    exported_deps = [
        "//folly/lang:exception",
        "//folly/result:rich_error_fwd",
    ],
)

### this line is a hint for source control merge

non_fbcode_target(
    _kind = folly_xplat_cxx_library,
    name = "rich_error_common",
    raw_headers = ["rich_error_common.h"],
    exported_deps = [
        "//xplat/folly:traits",
        "//xplat/folly/lang:pretty",
        "//xplat/folly/result:rich_error_base",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "rich_error_common",
    headers = ["rich_error_common.h"],
    exported_deps = [
        "//folly:traits",
        "//folly/lang:pretty",
        "//folly/result:rich_error_base",
    ],
)

### this line is a hint for source control merge

non_fbcode_target(
    _kind = folly_xplat_cxx_library,
    name = "rich_exception_ptr_storage",
    srcs = ["rich_exception_ptr_storage.cpp"],
    raw_headers = ["rich_exception_ptr_storage.h"],
    deps = [
        "//third-party/glog:glog",
    ],
    exported_deps = [
        ":immortal_exception_storage",
        "//xplat/folly:portability",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "rich_exception_ptr_storage",
    srcs = ["rich_exception_ptr_storage.cpp"],
    headers = ["rich_exception_ptr_storage.h"],
    exported_deps = [
        ":immortal_exception_storage",
        "//folly:portability",
    ],
    external_deps = ["glog"],
)
