Skip to content

Commit 796dc5d

Browse files
authored
build_variables.bzl: make THREADPOOL_SRCS usable in BUCK (#13354)
Making the structure in this file mirror buck's worldview more closely when it makes sense. #8268 Differential Revision: [D80187442](https://our.internmc.facebook.com/intern/diff/D80187442)
1 parent 830e753 commit 796dc5d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

extension/threadpool/targets.bzl

Lines changed: 4 additions & 5 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", "THREADPOOL_SRCS")
23
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
34

45
def define_common_targets():
@@ -8,11 +9,9 @@ def define_common_targets():
89
TARGETS and BUCK files that call this function.
910
"""
1011

11-
_THREADPOOL_SRCS = [
12-
"thread_parallel.cpp",
13-
"threadpool.cpp",
14-
"threadpool_guard.cpp",
15-
] + (["fb/threadpool_use_n_threads.cpp"] if not runtime.is_oss else [])
12+
_THREADPOOL_SRCS = THREADPOOL_SRCS + (
13+
["fb/threadpool_use_n_threads.cpp"] if not runtime.is_oss else []
14+
)
1615

1716
_THREADPOOL_HEADERS = [
1817
"threadpool.h",

shim_et/xplat/executorch/build/build_variables.bzl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,14 @@ EXTENSION_TENSOR_SRCS = [
363363
"extension/tensor/tensor_ptr_maker.cpp",
364364
]
365365

366-
EXTENSION_THREADPOOL_SRCS = [
367-
"extension/threadpool/thread_parallel.cpp",
368-
"extension/threadpool/threadpool.cpp",
369-
"extension/threadpool/threadpool_guard.cpp",
366+
THREADPOOL_SRCS = [
367+
"thread_parallel.cpp",
368+
"threadpool.cpp",
369+
"threadpool_guard.cpp",
370370
]
371371

372+
EXTENSION_THREADPOOL_SRCS = ["extension/threadpool/" + x for x in THREADPOOL_SRCS]
373+
372374
EXTENSION_TRAINING_SRCS = [
373375
"extension/data_loader/file_data_loader.cpp",
374376
"extension/data_loader/mmap_data_loader.cpp",

0 commit comments

Comments
 (0)