1
+ load ("@fbsource//tools/build_defs:platform_defs.bzl" , "ANDROID" , "APPLE" , "CXX" , "FBCODE" )
1
2
load ("@fbsource//xplat/executorch/build:runtime_wrapper.bzl" , "runtime" )
2
3
load ("@fbsource//xplat/executorch/third-party:glob_defs.bzl" , "subdir_glob" )
3
4
5
+ PLATFORMS = (CXX , ANDROID , APPLE , FBCODE )
6
+
4
7
def define_common_targets ():
5
8
"""Defines targets that should be shared between fbcode and xplat.
6
9
@@ -18,6 +21,7 @@ def define_common_targets():
18
21
"//pytorch/tokenizers/..." ,
19
22
],
20
23
header_namespace = "" ,
24
+ platforms = PLATFORMS ,
21
25
)
22
26
23
27
runtime .cxx_library (
@@ -39,6 +43,7 @@ def define_common_targets():
39
43
"sentencepiece" ,
40
44
"abseil-cpp" ,
41
45
],
46
+ platforms = PLATFORMS ,
42
47
)
43
48
44
49
runtime .cxx_library (
@@ -60,6 +65,7 @@ def define_common_targets():
60
65
exported_external_deps = [
61
66
"re2" ,
62
67
],
68
+ platforms = PLATFORMS ,
63
69
)
64
70
65
71
runtime .cxx_library (
@@ -72,6 +78,7 @@ def define_common_targets():
72
78
("include" , "pytorch/tokenizers/third-party/llama.cpp-unicode/*.h" ),
73
79
]),
74
80
header_namespace = "" ,
81
+ platforms = PLATFORMS ,
75
82
)
76
83
77
84
runtime .cxx_library (
@@ -97,6 +104,7 @@ def define_common_targets():
97
104
"re2" ,
98
105
"nlohmann_json" ,
99
106
],
107
+ platforms = PLATFORMS ,
100
108
)
101
109
102
110
runtime .cxx_library (
@@ -111,4 +119,5 @@ def define_common_targets():
111
119
"@EXECUTORCH_CLIENTS" ,
112
120
"//pytorch/tokenizers/..." ,
113
121
],
122
+ platforms = PLATFORMS ,
114
123
)
0 commit comments