# Part of the Crubit project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("//common:crubit_wrapper_macros_oss.bzl", "crubit_rust_test")

package(default_applicable_licenses = ["//:license"])

cc_library(
    name = "cc_helper_functions",
    testonly = True,
    hdrs = ["cc_helper_functions.h"],
    aspect_hints = [
        "//features:supported",
    ],
    deps = [
        ":cc_movable_types",
        "@abseil-cpp//absl/base:no_destructor",
    ],
)

cc_library(
    name = "cc_movable_types",
    testonly = True,
    hdrs = ["cc_movable_types.h"],
    aspect_hints = [
        "//features:supported",
    ],
)

crubit_rust_test(
    name = "test",
    srcs = ["test.rs"],
    cc_deps = [
        ":cc_helper_functions",
        ":cc_movable_types",
        "//support/public:cc_std",
    ],
    # LINT.IfChange
    rustc_flags = ["-Zallow-features=allocator_api"],
    # LINT.ThenChange(//docs/overview/unstable_features.md)
    deps = [
        "@crate_index//:googletest",
        "@crate_index//:static_assertions",  # v1
    ],
)
