Skip to content

Commit 63cce89

Browse files
committed
build_variables.bzl: split PROGRAM_NO_PRIM_OPS_SRCS from EXECUTORCH_CORE_SRCS
Making the structure in this file mirror buck's worldview more closely when it makes sense. #8268 ghstack-source-id: 0680306 ghstack-comment-id: 2652360900 Pull Request resolved: #8397
1 parent 8f5b757 commit 63cce89

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

build/build_variables.bzl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ EXECUTORCH_SRCS = [
1212
"kernels/prim_ops/register_prim_ops.cpp",
1313
]
1414

15-
EXECUTORCH_CORE_SRCS = [
15+
PROGRAM_NO_PRIM_OPS_SRCS = [
16+
"method.cpp",
17+
"method_meta.cpp",
18+
"program.cpp",
19+
"tensor_parser_exec_aten.cpp",
20+
]
21+
22+
EXECUTORCH_CORE_SRCS = sorted([
1623
"runtime/backend/interface.cpp",
1724
"runtime/core/evalue.cpp",
1825
"runtime/core/exec_aten/util/tensor_shape_to_c_string.cpp",
1926
"runtime/core/exec_aten/util/tensor_util_portable.cpp",
2027
"runtime/core/portable_type/tensor_impl.cpp",
2128
"runtime/core/tag.cpp",
22-
"runtime/executor/method.cpp",
23-
"runtime/executor/method_meta.cpp",
24-
"runtime/executor/program.cpp",
25-
"runtime/executor/tensor_parser_exec_aten.cpp",
2629
"runtime/executor/tensor_parser_portable.cpp",
2730
"runtime/kernel/operator_registry.cpp",
2831
"runtime/platform/abort.cpp",
@@ -31,7 +34,7 @@ EXECUTORCH_CORE_SRCS = [
3134
"runtime/platform/profiler.cpp",
3235
"runtime/platform/runtime.cpp",
3336
"schema/extended_header.cpp",
34-
]
37+
] + ["runtime/executor/" + x for x in PROGRAM_NO_PRIM_OPS_SRCS])
3538

3639
PORTABLE_KERNELS_SRCS = [
3740
"kernels/portable/cpu/op__empty_dim_order.cpp",

runtime/executor/targets.bzl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@fbsource//xplat/executorch/build:build_variables.bzl", "PROGRAM_NO_PRIM_OPS_SRCS")
12
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
23

34
def _program_preprocessor_flags():
@@ -58,11 +59,7 @@ def define_common_targets():
5859

5960
runtime.cxx_library(
6061
name = "program_no_prim_ops" + aten_suffix,
61-
srcs = [
62-
"method.cpp",
63-
"method_meta.cpp",
64-
"program.cpp",
65-
"tensor_parser_exec_aten.cpp",
62+
srcs = PROGRAM_NO_PRIM_OPS_SRCS + [
6663
"tensor_parser{}.cpp".format(aten_suffix if aten_mode else "_portable"),
6764
],
6865
headers = [

0 commit comments

Comments
 (0)