folly/folly/system/BUCK

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

oncall("fbcode_entropy_wardens_folly")

cpp_library(
    name = "at_fork",
    srcs = ["AtFork.cpp"],
    headers = ["AtFork.h"],
    deps = [
        "//folly:scope_guard",
        "//folly/lang:exception",
        "//folly/portability:pthread",
        "//folly/synchronization:sanitize_thread",
    ],
    exported_deps = [
        "//folly:function",
        "//folly/portability:sys_types",
    ],
)

cpp_library(
    name = "aux_vector",
    headers = ["AuxVector.h"],
    exported_deps = [
        "//folly:portability",
        "//folly:preprocessor",
    ],
)

cpp_library(
    name = "env_util",
    srcs = ["EnvUtil.cpp"],
    headers = ["EnvUtil.h"],
    deps = [
        "//folly:string",
        "//folly/portability:stdlib",
        "//folly/portability:unistd",
    ],
    exported_deps = [
        "//folly:c_portability",
        "//folly:memory",
    ],
    external_deps = [
        "glog",
    ],
)

cpp_library(
    name = "hardware_concurrency",
    srcs = ["HardwareConcurrency.cpp"],
    headers = [
        "HardwareConcurrency.h",
    ],
    deps = [
        "//folly/portability:sched",
    ],
)

cpp_library(
    name = "memory_mapping",
    srcs = ["MemoryMapping.cpp"],
    headers = ["MemoryMapping.h"],
    os_deps = [
        (
            "linux",
            ["//folly/experimental/io:huge_pages"],
        ),
    ],
    deps = [
        "fbsource//third-party/fmt:fmt",
        "//folly:portability",
        "//folly/portability:gflags",
        "//folly/portability:sys_mman",
        "//folly/portability:sys_syscall",
    ],
    exported_deps = [
        "//folly:file",
        "//folly:range",
        "//folly/portability:unistd",
    ],
    external_deps = [
        "glog",
    ],
)

cpp_library(
    name = "pid",
    srcs = ["Pid.cpp"],
    headers = ["Pid.h"],
    deps = [
        ":at_fork",
        "//folly/portability:unistd",
    ],
    exported_deps = [
        "//folly/portability:sys_types",
    ],
    external_deps = [
        "glog",
    ],
)

cpp_library(
    name = "shell",
    srcs = ["Shell.cpp"],
    headers = ["Shell.h"],
    exported_deps = [
        "//folly:conv",
        "//folly:format",
        "//folly:range",
    ],
)

cpp_library(
    name = "thread_id",
    srcs = ["ThreadId.cpp"],
    headers = ["ThreadId.h"],
    deps = [
        ":at_fork",
        "//folly:likely",
        "//folly/portability:pthread",
        "//folly/portability:sys_syscall",
        "//folly/portability:unistd",
        "//folly/portability:windows",
        "//folly/synchronization:relaxed_atomic",
    ],
)

cpp_library(
    name = "thread_name",
    srcs = ["ThreadName.cpp"],
    headers = ["ThreadName.h"],
    deps = [
        "//folly:portability",
        "//folly:scope_guard",
        "//folly:traits",
        "//folly/portability:windows",
    ],
    exported_deps = [
        "//folly:optional",
        "//folly:range",
        "//folly/portability:config",
        "//folly/portability:pthread",
    ],
)