load("//:CPPVARIABLES.bzl", "DDS_CPPOPTS", "DDS_LINKOPTS", "DDS_LOCAL_DEFINES", "DDS_SCHEDULER_DEFINE")
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
    name = "system",
    srcs = glob(["*.cpp"]),
    hdrs = glob(["*.hpp", "util/*.hpp"]),
    visibility = ["//visibility:public"],
    includes = ["."],
    deps = [
        "//library/src/utility:constants",
        "//library/src/lookup_tables:lookup_tables",
        "//library/src/api:api_definitions",
        "//library/src/trans_table",
        "//library/src/moves:moves",
        # Utilities lives under system/util (header-only for now)
    ],
    include_prefix = "system",
    copts = DDS_CPPOPTS,
    linkopts = DDS_LINKOPTS,
    local_defines = DDS_LOCAL_DEFINES + DDS_SCHEDULER_DEFINE,
)

# Variant with Utilities logging enabled for tests that assert log behavior
cc_library(
    name = "system_util_log",
    srcs = glob(["*.cpp"]),
    hdrs = glob(["*.hpp", "util/*.hpp"]),
    visibility = ["//visibility:public"],
    includes = ["."],
    deps = [
        "//library/src/utility:constants",
        "//library/src/lookup_tables:lookup_tables",
    "//library/src/api:api_definitions",
        "//library/src/trans_table",
        "//library/src/moves:moves",
    ],
    include_prefix = "system",
    copts = DDS_CPPOPTS,
    linkopts = DDS_LINKOPTS,
    local_defines = DDS_LOCAL_DEFINES + DDS_SCHEDULER_DEFINE + ["DDS_UTILITIES_LOG"],
)

cc_library(
    name = "system_util_stats",
    srcs = glob(["*.cpp"]),
    hdrs = glob(["*.hpp", "util/*.hpp"]),
    visibility = ["//visibility:public"],
    includes = ["."],
    deps = [
        "//library/src/utility:constants",
        "//library/src/lookup_tables:lookup_tables",
    "//library/src/api:api_definitions",
        "//library/src/trans_table",
        "//library/src/moves:moves",
    ],
    include_prefix = "system",
    copts = DDS_CPPOPTS,
    linkopts = DDS_LINKOPTS,
    local_defines = DDS_LOCAL_DEFINES + DDS_SCHEDULER_DEFINE + ["DDS_UTILITIES_STATS"],
)
