"""Bazel module definition for cel-cxx (libcel)."""
module(
    name = "cel",
)

# Core dependencies
bazel_dep(name = "rules_cc", version = "0.1.2")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.8.0")

# Apple/iOS support (needed for Apple platform constraints)
bazel_dep(name = "apple_support", version = "1.22.0")

# Android NDK support (conditional - only when ANDROID_NDK_HOME is set)
bazel_dep(name = "rules_android_ndk", version = "0.1.3")

# Use our conditional Android NDK extension
# This creates either a real Android NDK repository or a stub, depending on ANDROID_NDK_HOME
android_conditional = use_extension("//:android_conditional.bzl", "conditional_android_ndk")
use_repo(android_conditional, "androidndk")

# Register Android NDK toolchains
# This will register empty toolchains if Android NDK is not available
register_toolchains("@androidndk//:all")

# Cross-compilation support for cross-rs
bazel_dep(name = "rules_cross_rs", version = "0.1.0")
git_override(
    module_name = "rules_cross_rs",
    remote = "https://github.com/xjasonli/rules_cross_rs.git",
    commit = "234adc1401b8fd43d8fd4837c09cefef5e3c672c",
)

# Abseil-CPP dependency
bazel_dep(
    name = "abseil-cpp",
    version = "20250512.1",
    repo_name = "com_google_absl",
)

# CEL-CPP dependency
bazel_dep(name = "cel-cpp")
git_override(
    module_name = "cel-cpp",
    # We need some patches
    remote = "https://github.com/xjasonli/cel-cpp.git",
    commit = "b761a2e64e6f74ccab35149bef616219f911f7ed",
)
