Skip to content

Commit 166f56b

Browse files
authored
build_variables.bzl: make XNNPACK_BACKEND_SRCS usable in BUCK (#13356)
Making the structure in this file mirror buck's worldview more closely when it makes sense. #8268
1 parent 3a1fba7 commit 166f56b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

backends/xnnpack/targets.bzl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@fbsource//xplat/executorch/backends/xnnpack/third-party:third_party_libs.bzl", "third_party_dep")
2+
load("@fbsource//xplat/executorch/build:build_variables.bzl", "XNNPACK_BACKEND_BUCK_SRCS")
23
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime")
34

45
def _get_preprocessor_flags():
@@ -37,10 +38,7 @@ def define_common_targets():
3738
aten_suffix = "_aten" if aten_mode else ""
3839
runtime.cxx_library(
3940
name = "xnnpack_backend" + aten_suffix,
40-
srcs = native.glob([
41-
"runtime/*.cpp",
42-
"runtime/profiling/*.cpp",
43-
]),
41+
srcs = XNNPACK_BACKEND_BUCK_SRCS,
4442
headers = native.glob([
4543
"runtime/*.h",
4644
"runtime/profiling/*.h",

shim_et/xplat/executorch/build/build_variables.bzl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,15 +474,17 @@ XNN_EXECUTOR_RUNNER_SRCS = [
474474
"extension/data_loader/file_data_loader.cpp",
475475
]
476476

477-
XNNPACK_BACKEND_SRCS = [
478-
"backends/xnnpack/runtime/XNNCompiler.cpp",
479-
"backends/xnnpack/runtime/XNNExecutor.cpp",
480-
"backends/xnnpack/runtime/XNNHeader.cpp",
481-
"backends/xnnpack/runtime/XNNPACKBackend.cpp",
482-
"backends/xnnpack/runtime/XNNWeightsCache.cpp",
483-
"backends/xnnpack/runtime/profiling/XNNProfiler.cpp",
477+
XNNPACK_BACKEND_BUCK_SRCS = [
478+
"runtime/XNNCompiler.cpp",
479+
"runtime/XNNExecutor.cpp",
480+
"runtime/XNNHeader.cpp",
481+
"runtime/XNNPACKBackend.cpp",
482+
"runtime/XNNWeightsCache.cpp",
483+
"runtime/profiling/XNNProfiler.cpp",
484484
]
485485

486+
XNNPACK_BACKEND_SRCS = ["backends/xnnpack/" + x for x in XNNPACK_BACKEND_BUCK_SRCS]
487+
486488
XNNPACK_SCHEMA_SRCS = [
487489
"backends/xnnpack/serialization/runtime_schema.fbs",
488490
]

0 commit comments

Comments
 (0)