xref: /aosp_15_r20/external/executorch/devtools/bundled_program/targets.bzl (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2
3def define_common_targets():
4    """Defines targets that should be shared between fbcode and xplat.
5
6    The directory containing this targets.bzl file should also contain both
7    TARGETS and BUCK files that call this function.
8    """
9
10    for aten_mode in (True, False):
11        aten_suffix = ("_aten" if aten_mode else "")
12        runtime.cxx_library(
13            name = "runtime" + aten_suffix,
14            srcs = ["bundled_program.cpp"],
15            exported_headers = ["bundled_program.h"],
16            visibility = [
17                "//executorch/...",
18                "@EXECUTORCH_CLIENTS",
19            ],
20            deps = [
21                "//executorch/runtime/core/exec_aten/util:dim_order_util" + aten_suffix,
22                "//executorch/devtools/bundled_program/schema:bundled_program_schema_fbs",
23            ],
24            exported_deps = [
25                "//executorch/runtime/core:memory_allocator",
26                "//executorch/runtime/executor:program" + aten_suffix,
27            ],
28        )
29