# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain fbcode-only targets.

load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()

fbcode_target(
    _kind = runtime.cxx_python_extension,
    name = "pybindings",
    srcs = [
        "pybindings.cpp",
    ],
    base_module = "executorch.extension.pytree",
    deps = [
        ":pytree",
    ],
    external_deps = [
        "pybind11",
    ],
)

fbcode_target(
    _kind = runtime.cxx_python_extension,
    name = "pybindings_debug",
    srcs = [
        "pybindings.cpp",
    ],
    base_module = "executorch.extension.pytree",
    deps = [
        ":pytree",
    ],
    external_deps = [
        "pybind11",
    ],
)

fbcode_target(
    _kind = runtime.python_library,
    name = "pylib",
    srcs = [
        "__init__.py",
    ],
    base_module = "executorch.extension.pytree",
    deps = [
        ":pybindings",
        "//caffe2:torch",
    ],
)
