xref: /aosp_15_r20/external/executorch/test/utils/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 = "utils" + aten_suffix,
15            srcs = [
16                "UnitTestMain.cpp",
17            ],
18            exported_headers = [
19                "alignment.h",
20                "DeathTest.h",
21            ],
22            visibility = [
23                "//executorch/...",
24                "@EXECUTORCH_CLIENTS",
25            ],
26            deps = [
27                "//executorch/runtime/platform:platform",
28                "//executorch/runtime/core:core",
29            ],
30            exported_external_deps = [
31                "gtest" + aten_suffix,
32                "gmock" + aten_suffix,
33            ],
34        )
35
36        runtime.cxx_test(
37            name = "alignment_test" + aten_suffix,
38            srcs = [
39                "alignment_test.cpp",
40            ],
41            deps = [
42                ":utils" + aten_suffix,
43            ],
44        )
45