xref: /aosp_15_r20/external/executorch/extension/runner_util/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
13        runtime.cxx_library(
14            name = "inputs" + aten_suffix,
15            srcs = [
16                "inputs.cpp",
17                "inputs{}.cpp".format("_aten" if aten_mode else "_portable"),
18            ],
19            exported_headers = ["inputs.h"],
20            visibility = [
21                "//executorch/...",
22                "@EXECUTORCH_CLIENTS",
23            ],
24            exported_deps = [
25                "//executorch/runtime/core/exec_aten:lib" + aten_suffix,
26                "//executorch/runtime/executor:program" + aten_suffix,
27            ],
28        )
29