xref: /aosp_15_r20/external/executorch/backends/cadence/hifi/operators/targets.bzl (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1load("@fbsource//tools/build_defs:platform_defs.bzl", "CXX")
2load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
3
4def define_common_targets():
5    """Defines targets that should be shared between fbcode and xplat.
6
7    The directory containing this targets.bzl file should also contain both
8    TARGETS and BUCK files that call this function.
9    """
10
11    # Define build targets for all operators registered in the tables above.
12
13    runtime.cxx_library(
14        name = "cadence_hifi_ops",
15        srcs = glob([
16            "*.cpp",
17        ]),
18        exported_headers = glob(["*.h"]),
19        platforms = CXX,
20        deps = [
21            "//executorch/kernels/portable/cpu/util:all_deps",
22            "//executorch/kernels/portable/cpu/pattern:all_deps",
23            "//executorch/runtime/kernel:kernel_includes",
24            "//executorch/kernels/portable/cpu:scalar_utils",
25            "fbsource//third-party/nnlib-hifi4/xa_nnlib:libxa_nnlib",
26            "fbsource//third-party/nnlib-hifi4/xa_nnlib:libxa_nnlib_common",
27            "//executorch/backends/cadence/hifi/kernels:kernels",
28        ],
29        visibility = [
30            "//executorch/backends/cadence/...",
31            "@EXECUTORCH_CLIENTS",
32        ],
33    )
34