genrule(
    name = "wpilib_version",
    outs = ["WPILibVersion.cc"],
    cmd = "\n".join([
        "cat > \"$@\" << EOF",
        "// Autogenerated file! Do not manually edit this file.",
        "#include \"frc971/wpilib/ahal/WPILibVersion.h\"",
        "const char *WPILibVersion = \"2018-frc971\";",
        "EOF",
    ]),
    target_compatible_with = ["@platforms//os:linux"],
)

cc_library(
    name = "ahal",
    srcs = glob(["*.cc"]) + [":wpilib_version"],
    hdrs = glob(["*.h"]),
    target_compatible_with = ["//tools/platforms/hardware:roborio"],
    visibility = ["//third_party:__pkg__"],
    deps = [
        "//aos:realtime",
        "//aos/logging",
        "//third_party:wpilib_hal",
        "@com_google_absl//absl/types:span",
    ],
)
