-
Notifications
You must be signed in to change notification settings - Fork 527
/
Copy pathtargets.bzl
51 lines (44 loc) · 1.7 KB
/
targets.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_oss_build_kwargs", "runtime")
SIZE_TEST_SOURCES = [
"size_test.cpp",
]
SIZE_TEST_DEPS = [
"//executorch/runtime/executor:program",
"//executorch/extension/data_loader:file_data_loader",
]
def define_common_targets():
"""Defines targets that should be shared between fbcode and xplat.
The directory containing this targets.bzl file should also contain both
TARGETS and BUCK files that call this function.
"""
# DO NOT MODIFY: This target `size_test_static` is being used on a per-diff
# CI job to guard Executorch binary size. It doesn't contain any operators
# or kernels thus shouldn't be used to run a model. Adding/removing dependencies
# will likely result in inaccurate measure results.
#
# It's also best to build this with `-c executorch.enable_program_verification=false`
# to remove ~30kB of optional flatbuffer verification code from the binary.
# Building with `-c executorch.enable_et_log=0` removes ~15kB from the binary.
runtime.cxx_binary(
name = "size_test",
srcs = SIZE_TEST_SOURCES,
deps = SIZE_TEST_DEPS,
define_static_target = True,
**get_oss_build_kwargs()
)
runtime.cxx_binary(
name = "size_test_all_ops",
srcs = SIZE_TEST_SOURCES,
deps = SIZE_TEST_DEPS + [
"//executorch/kernels/portable:generated_lib",
"//executorch/runtime/executor/test:test_backend_compiler_lib",
],
define_static_target = True,
**get_oss_build_kwargs()
)
runtime.export_file(
name = "size_test.cpp",
visibility = [
"@EXECUTORCH_CLIENTS",
],
)