@@ -17,10 +17,8 @@ def define_common_targets(is_fbcode = False):
1717 ],
1818 deps = [
1919 "//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+ ],
2422 )
2523
2624 runtime .python_binary (
@@ -29,7 +27,7 @@ def define_common_targets(is_fbcode = False):
2927 deps = [
3028 ":gen_oplist_lib" ,
3129 ],
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" ],
3331 package_style = "inplace" ,
3432 visibility = [
3533 "//executorch/..." ,
@@ -196,27 +194,35 @@ def define_common_targets(is_fbcode = False):
196194 _is_external_target = True ,
197195 )
198196
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+ "-Wall" ,
215+ ],
216+ deps = [
217+ "//executorch/runtime/core:core" ,
218+ "//executorch/schema:program" ,
219+ ],
220+ external_deps = [
221+ "pybind11" ,
222+ ],
223+ use_static_deps = True ,
224+ visibility = ["//executorch/codegen/..." ],
225+ )
220226
221227
222228 # 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 +261,20 @@ def define_common_targets(is_fbcode = False):
255261 ],
256262 )
257263
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- )
264+ runtime .python_test (
265+ name = "test_tools_selective_build " ,
266+ srcs = [
267+ "test/test_tools_selective_build .py" ,
268+ ],
269+ package_style = "inplace" ,
270+ visibility = [
271+ "PUBLIC" ,
272+ ],
273+ deps = [
274+ ":selective_build" ,
275+ "fbsource//third-party/pypi/expecttest:expecttest" ,
276+ "//caffe2:torch" ,
277+ "//executorch/exir:lib" ,
278+ ],
279+ _is_external_target = True ,
280+ )
0 commit comments