xref: /aosp_15_r20/external/pytorch/c10/mobile/build.bzl (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1def define_targets(rules):
2    rules.cc_library(
3        name = "CPUCachingAllocator",
4        srcs = ["CPUCachingAllocator.cpp"],
5        hdrs = ["CPUCachingAllocator.h"],
6        linkstatic = True,
7        local_defines = ["C10_BUILD_MAIN_LIB"],
8        visibility = ["//visibility:public"],
9        deps = [
10            "//c10/core:alloc_cpu",
11            "//c10/util:base",
12        ],
13    )
14
15    rules.cc_library(
16        name = "CPUProfilingAllocator",
17        srcs = ["CPUProfilingAllocator.cpp"],
18        hdrs = ["CPUProfilingAllocator.h"],
19        linkstatic = True,
20        local_defines = ["C10_BUILD_MAIN_LIB"],
21        visibility = ["//visibility:public"],
22        deps = [
23            "//c10/core:alloc_cpu",
24            "//c10/util:base",
25        ],
26    )
27
28    rules.filegroup(
29        name = "headers",
30        srcs = rules.glob(["*.h"]),
31        visibility = ["//c10:__pkg__"],
32    )
33