@@ -196,27 +196,35 @@ def define_common_targets(is_fbcode = False):
196196 _is_external_target = True ,
197197 )
198198
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- )
199+
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+ compiler_flags = [
211+ "-Wno-deprecated-declarations" ,
212+ "-fPIC" ,
213+ "-frtti" ,
214+ "-fexceptions" ,
215+ "-Werror" ,
216+ "-Wall" ,
217+ ],
218+ deps = [
219+ "//executorch/runtime/core:core" ,
220+ "//executorch/schema:program" ,
221+ ],
222+ external_deps = [
223+ "pybind11" ,
224+ ],
225+ use_static_deps = True ,
226+ visibility = ["//executorch/codegen/..." ],
227+ )
220228
221229
222230 # 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 +263,20 @@ def define_common_targets(is_fbcode = False):
255263 ],
256264 )
257265
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- )
266+ runtime .python_test (
267+ name = "test_tools_selective_build " ,
268+ srcs = [
269+ "test/test_tools_selective_build .py" ,
270+ ],
271+ package_style = "inplace" ,
272+ visibility = [
273+ "PUBLIC" ,
274+ ],
275+ deps = [
276+ ":selective_build" ,
277+ "fbsource//third-party/pypi/expecttest:expecttest" ,
278+ "//caffe2:torch" ,
279+ "//executorch/exir:lib" ,
280+ ],
281+ _is_external_target = True ,
282+ )
0 commit comments