load("@prelude//platforms:defs.bzl", "execution_platform")
load("@prelude//tests:test_toolchain.bzl", "noop_test_toolchain")
load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain")
load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain")
load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain", "system_python_toolchain")
load("@prelude//toolchains:remote_test_execution.bzl", "remote_test_execution_toolchain")

oncall("executorch")

# Although the non-Android toolchains below are present in shim/BUCK, it appears that we
# have to duplicate them here or builds won't work.
system_cxx_toolchain(
    name = "cxx",
    cxx_flags = ["-std=c++20"],
    visibility = ["PUBLIC"],
)

system_genrule_toolchain(
    name = "genrule",
    visibility = ["PUBLIC"],
)

system_python_toolchain(
    name = "python",
    visibility = ["PUBLIC"],
)

system_python_bootstrap_toolchain(
    name = "python_bootstrap",
    visibility = ["PUBLIC"],
)

execution_platform(
    name = "android-arm64",
    cpu_configuration = "prelude//cpu:arm64",
    os_configuration = "prelude//os:android",
    # REVIEW: not sure if this is correct
    use_windows_path_separators = host_info().os.is_windows,
    visibility = ["PUBLIC"],
)

execution_platform(
    name = "android-x86_64",
    cpu_configuration = "prelude//cpu:x86_64",
    os_configuration = "prelude//os:android",
    # REVIEW: not sure if this is correct
    use_windows_path_separators = host_info().os.is_windows,
    visibility = ["PUBLIC"],
)

noop_test_toolchain(
    name = "test",
    visibility = ["PUBLIC"],
)

remote_test_execution_toolchain(
    name = "remote_test_execution",
    visibility = ["PUBLIC"],
)
