xref: /aosp_15_r20/external/executorch/extension/training/module/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 = "training_module" + aten_suffix,
15            srcs = [
16                "training_module.cpp",
17            ],
18            exported_headers = [
19                "training_module.h",
20            ],
21            visibility = [
22                "@EXECUTORCH_CLIENTS",
23            ],
24            exported_deps = [
25                "//executorch/extension/module:module" + aten_suffix,
26                "//executorch/runtime/core:evalue" + aten_suffix,
27            ],
28        )
29