@@ -17,10 +17,8 @@ def define_common_targets(is_fbcode = False):
17
17
],
18
18
deps = [
19
19
"//executorch/codegen:gen_lib" ,
20
- ] + ([] if runtime .is_oss else select ({
21
- "DEFAULT" : [],
22
- "ovr_config//os:linux" : ["//executorch/codegen/tools:selective_build" ], # TODO(larryliu0820) :selective_build doesn't build in OSS yet
23
- })),
20
+ "//executorch/codegen/tools:selective_build" ,
21
+ ],
24
22
)
25
23
26
24
runtime .python_binary (
@@ -29,7 +27,7 @@ def define_common_targets(is_fbcode = False):
29
27
deps = [
30
28
":gen_oplist_lib" ,
31
29
],
32
- preload_deps = [] if runtime . is_oss else [ "//executorch/codegen/tools:selective_build" ], # TODO(larryliu0820) :selective_build doesn't build in OSS yet
30
+ preload_deps = ["//executorch/codegen/tools:selective_build" ],
33
31
package_style = "inplace" ,
34
32
visibility = [
35
33
"//executorch/..." ,
@@ -196,27 +194,36 @@ def define_common_targets(is_fbcode = False):
196
194
_is_external_target = True ,
197
195
)
198
196
199
- if not runtime .is_oss :
200
- runtime .cxx_python_extension (
201
- name = "selective_build" ,
202
- srcs = [
203
- "selective_build.cpp" ,
204
- ],
205
- base_module = "executorch.codegen.tools" ,
206
- types = ["selective_build.pyi" ],
207
- preprocessor_flags = [
208
- "-DEXECUTORCH_PYTHON_MODULE_NAME=selective_build" ,
209
- ],
210
- deps = [
211
- "//executorch/runtime/core:core" ,
212
- "//executorch/schema:program" ,
213
- ],
214
- external_deps = [
215
- "pybind11" ,
216
- ],
217
- use_static_deps = True ,
218
- visibility = ["//executorch/codegen/..." ],
219
- )
197
+
198
+ runtime .cxx_python_extension (
199
+ name = "selective_build" ,
200
+ srcs = [
201
+ "selective_build.cpp" ,
202
+ ],
203
+ base_module = "executorch.codegen.tools" ,
204
+ types = ["selective_build.pyi" ],
205
+ preprocessor_flags = [
206
+ "-DEXECUTORCH_PYTHON_MODULE_NAME=selective_build" ,
207
+ ],
208
+ compiler_flags = [
209
+ "-Wno-deprecated-declarations" ,
210
+ "-fPIC" ,
211
+ "-frtti" ,
212
+ "-fexceptions" ,
213
+ "-Werror" ,
214
+ "-Wunused-variable" ,
215
+ "-Wno-unknown-argument" ,
216
+ ],
217
+ deps = [
218
+ "//executorch/runtime/core:core" ,
219
+ "//executorch/schema:program" ,
220
+ ],
221
+ external_deps = [
222
+ "pybind11" ,
223
+ ],
224
+ use_static_deps = True ,
225
+ visibility = ["//executorch/codegen/..." ],
226
+ )
220
227
221
228
222
229
# TODO(larryliu0820): This is a hack to only run these two on fbcode. These targets depends on exir which is only available in fbcode.
@@ -255,20 +262,20 @@ def define_common_targets(is_fbcode = False):
255
262
],
256
263
)
257
264
258
- runtime .python_test (
259
- name = "test_selective_build " ,
260
- srcs = [
261
- "test/test_selective_build .py" ,
262
- ],
263
- package_style = "inplace" ,
264
- visibility = [
265
- "PUBLIC" ,
266
- ],
267
- deps = [
268
- ":selective_build" ,
269
- "fbsource//third-party/pypi/expecttest:expecttest" ,
270
- "//caffe2:torch" ,
271
- "//executorch/exir:lib" ,
272
- ],
273
- _is_external_target = True ,
274
- )
265
+ runtime .python_test (
266
+ name = "test_tools_selective_build " ,
267
+ srcs = [
268
+ "test/test_tools_selective_build .py" ,
269
+ ],
270
+ package_style = "inplace" ,
271
+ visibility = [
272
+ "PUBLIC" ,
273
+ ],
274
+ deps = [
275
+ ":selective_build" ,
276
+ "fbsource//third-party/pypi/expecttest:expecttest" ,
277
+ "//caffe2:torch" ,
278
+ "//executorch/exir:lib" ,
279
+ ],
280
+ _is_external_target = True ,
281
+ )
0 commit comments