load("//tools:copts.bzl", "COPTS")

cc_library(
    name = "game_settings",
    srcs = [
        "GameSettings.cpp",
        "GeneratedGameSettings.cpp",
    ],
    hdrs = ["GameSettings.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok:__subpackages__",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library:battalion_type",
        "//src/main/flatbuffer/net/eagle0/shardok/storage:battalion_type_cc_fbs",
        "//src/main/flatbuffer/net/eagle0/shardok/storage:weather_cc_fbs",
        "//src/main/protobuf/net/eagle0/shardok/common:weather_cc_proto",
        "//src/main/resources/net/eagle0/shardok:settings_fbs",
        "//src/main/resources/net/eagle0/shardok:settings_keys",
    ],
)

genrule(
    name = "settings_class_gen",
    srcs = ["//src/main/resources/net/eagle0/shardok:settings"],
    outs = ["GeneratedGameSettings.cpp"],
    cmd = "./$(location //src/main/go/net/eagle0/build/cpp_settings_setters_generator) $(location //src/main/resources/net/eagle0/shardok:settings) > $@",
    tools = ["//src/main/go/net/eagle0/build/cpp_settings_setters_generator"],
)
