• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load(
2    "@fbsource//tools/build_defs:default_platform_defs.bzl",
3    "ANDROID",
4    "CXX",
5)
6load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
7load("@fbsource//xplat/executorch/extension/pybindings:pybindings.bzl", "MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB")
8
9def define_common_targets():
10    """Defines targets that should be shared between fbcode and xplat.
11
12    The directory containing this targets.bzl file should also contain both
13    TARGETS and BUCK files that call this function.
14    """
15
16    runtime.cxx_library(
17        name = "executor_backend",
18        srcs = [
19            "ExecutorBackend.cpp",
20        ],
21        exported_headers = [
22            "ExecutorBackend.h",
23        ],
24        platforms = [ANDROID, CXX],
25        deps = [
26            "//executorch/runtime/executor:program",
27            "//executorch/kernels/portable:generated_lib",
28            "//executorch/runtime/backend:interface",
29            "//executorch/extension/data_loader:buffer_data_loader",
30        ] + MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB,
31        exported_deps = [
32            "//executorch/runtime/core:core",
33        ],
34    )
35
36    runtime.cxx_library(
37        name = "executor_backend_register",
38        srcs = [
39            "ExecutorBackendRegister.cpp",
40        ],
41        visibility = [
42            "//executorch/exir/backend/test/...",
43        ],
44        deps = [
45            ":executor_backend",
46            "//executorch/runtime/backend:interface",
47            "//executorch/runtime/core:core",
48        ],
49        platforms = [ANDROID, CXX],
50    )
51