@@ -20,7 +20,7 @@ def define_common_targets():
20
20
] + (["fb/threadpool_use_n_threads.h" ] if not runtime .is_oss else [])
21
21
22
22
runtime .cxx_library (
23
- name = "threadpool " ,
23
+ name = "threadpool_lib " ,
24
24
srcs = _THREADPOOL_SRCS ,
25
25
deps = [
26
26
"//executorch/runtime/core:core" ,
@@ -45,6 +45,38 @@ def define_common_targets():
45
45
],
46
46
)
47
47
48
+ runtime .cxx_library (
49
+ name = "threadpool" ,
50
+ # TODO: OSS doesn't have os:iphoneos. Sync buck2 prelude
51
+ # update to add it and remove duplication.
52
+ exported_deps = (select ({
53
+ # Major operating systems should be able to use threadpool.
54
+ "ovr_config//os:linux" : [":threadpool_lib" ],
55
+ "ovr_config//os:macos" : [":threadpool_lib" ],
56
+ "ovr_config//os:windows" : [":threadpool_lib" ],
57
+ "ovr_config//os:android" : [":threadpool_lib" ],
58
+ "ovr_config//os:iphoneos" : [":threadpool_lib" ],
59
+ # Machines without an operating system shouldn't.
60
+ "ovr_config//os:none" : ["//executorch/runtime/kernel:thread_parallel_interface" ],
61
+ # If we don't know what it is, disable threadpool out of caution.
62
+ "DEFAULT" : ["//executorch/runtime/kernel:thread_parallel_interface" ],
63
+ }) if not runtime .is_oss else select ({
64
+ # Major operating systems should be able to use threadpool.
65
+ "ovr_config//os:linux" : [":threadpool_lib" ],
66
+ "ovr_config//os:macos" : [":threadpool_lib" ],
67
+ "ovr_config//os:windows" : [":threadpool_lib" ],
68
+ "ovr_config//os:android" : [":threadpool_lib" ],
69
+ # Machines without an operating system shouldn't.
70
+ "ovr_config//os:none" : ["//executorch/runtime/kernel:thread_parallel_interface" ],
71
+ # If we don't know what it is, disable threadpool out of caution.
72
+ "DEFAULT" : ["//executorch/runtime/kernel:thread_parallel_interface" ],
73
+ })),
74
+ visibility = [
75
+ "//executorch/..." ,
76
+ "@EXECUTORCH_CLIENTS" ,
77
+ ],
78
+ )
79
+
48
80
runtime .cxx_library (
49
81
name = "cpuinfo_utils" ,
50
82
srcs = [
0 commit comments