Skip to content

Commit ff0f92e

Browse files
authored
merge fbcode-only TARGETS rules into existing targets.bzl files (pytorch#21145)
Differential Revision: D109082046 Pull Request resolved: pytorch#21145
1 parent 1fb8b57 commit ff0f92e

9 files changed

Lines changed: 410 additions & 428 deletions

File tree

backends/cortex_m/test/BUCK

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
78
load("targets.bzl", "define_common_targets")
89

910
oncall("executorch")
1011

11-
define_common_targets()
12+
define_common_targets(is_fbcode = is_fbcode())

backends/cortex_m/test/TARGETS

Lines changed: 0 additions & 30 deletions
This file was deleted.

backends/cortex_m/test/targets.bzl

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest")
78
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
89
load("@fbsource//tools/build_defs:platform_defs.bzl", "CXX")
910

@@ -29,13 +30,24 @@ def define_operator_test_target(op):
2930
]
3031
)
3132

32-
def define_common_targets():
33-
"""Defines targets that should be shared between fbcode and xplat.
34-
35-
The directory containing this targets.bzl file should also contain both
36-
TARGETS and BUCK files that call this function.
37-
"""
33+
def define_common_targets(is_fbcode = False):
34+
"""Defines targets that should be shared between fbcode and xplat."""
3835
for op in OPERATORS:
3936
define_operator_test_target(op)
4037

38+
if is_fbcode:
39+
python_unittest(
40+
name = "test_replace_quant_nodes",
41+
srcs = [
42+
"test_helpers_passes_utils.py",
43+
"test_replace_quant_nodes.py",
44+
],
45+
deps = [
46+
"//pytorch/ao:torchao", # @manual
47+
"//caffe2:torch",
48+
"//executorch/backends/cortex_m/passes:replace_quant_nodes_pass",
49+
"//executorch/backends/cortex_m/ops:ops",
50+
],
51+
)
52+
4153

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Any targets that should be shared between fbcode and xplat must be defined in
2-
# targets.bzl. This file can contain xplat-only targets.
2+
# targets.bzl.
33

4+
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
45
load(":targets.bzl", "define_common_targets")
56

67
oncall("executorch")
78

8-
define_common_targets()
9+
define_common_targets(is_fbcode = is_fbcode())

examples/qualcomm/oss_scripts/llama/TARGETS

Lines changed: 0 additions & 280 deletions
This file was deleted.

0 commit comments

Comments
 (0)