xref: /aosp_15_r20/external/executorch/kernels/aten/cpu/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    # Utility functions that can be used by operators that perform reduction
11    runtime.cxx_library(
12        name = "copy_ops_util",
13        srcs = ["copy_ops_util.cpp"],
14        exported_headers = [
15            "copy_ops_util.h",
16        ],
17        compiler_flags = select({
18                "DEFAULT": ["-Wno-missing-prototypes"],
19                "ovr_config//os:windows": [],
20            }),
21        deps = [
22            "//executorch/runtime/kernel:kernel_includes_aten",
23            "//executorch/runtime/core/exec_aten/util:tensor_util_aten",
24        ],
25        exported_preprocessor_flags = ["-DUSE_ATEN_LIB"],
26        visibility = [
27            "//executorch/kernels/aten/cpu/...",
28            "//executorch/kernels/portable/cpu/...",
29            "//executorch/kernels/optimized/cpu/...",
30        ],
31    )
32