@@ -49,43 +49,6 @@ def define_common_targets():
49
49
The directory containing this targets.bzl file should also contain both
50
50
TARGETS and BUCK files that call this function.
51
51
"""
52
- runtime .cxx_library (
53
- name = "c10" ,
54
- header_namespace = "c10" ,
55
- exported_headers = [
56
- "macros/Export.h" ,
57
- "macros/Macros.h" ,
58
- "util/BFloat16.h" ,
59
- "util/BFloat16-inl.h" ,
60
- "util/BFloat16-math.h" ,
61
- "util/Half.h" ,
62
- "util/Half-inl.h" ,
63
- "util/TypeSafeSignMath.h" ,
64
- "util/bit_cast.h" ,
65
- "util/complex.h" ,
66
- "util/complex_math.h" ,
67
- "util/complex_utils.h" ,
68
- "util/floating_point_utils.h" ,
69
- "util/irange.h" ,
70
- ],
71
- exported_preprocessor_flags = [
72
- "-DC10_USING_CUSTOM_GENERATED_MACROS" ,
73
- ] + ([] if runtime .is_oss else [
74
- "-DC10_USE_GLOG" ,
75
- "-DC10_USE_MINIMAL_GLOG" ,
76
- ]),
77
- visibility = [
78
- "//executorch/..." ,
79
- "@EXECUTORCH_CLIENTS" ,
80
- ],
81
- deps = select ({
82
- "DEFAULT" : [],
83
- # Half-inl.h depends on vec_half.h from ATen, but only when building for x86.
84
- "ovr_config//cpu:x86_64" : [
85
- ":aten_headers_for_executorch" ,
86
- ],
87
- }),
88
- )
89
52
90
53
runtime .cxx_library (
91
54
name = "aten_headers_for_executorch" ,
@@ -118,3 +81,51 @@ def define_common_targets():
118
81
fbcode_exported_preprocessor_flags = get_preprocessor_flags (is_fbcode = True )
119
82
+ ([] if runtime .is_oss else ["-DET_USE_PYTORCH_HEADERS" ]),
120
83
)
84
+
85
+ if runtime .is_oss :
86
+ runtime .cxx_library (
87
+ name = "c10" ,
88
+ header_namespace = "c10" ,
89
+ exported_headers = [
90
+ "macros/Export.h" ,
91
+ "macros/Macros.h" ,
92
+ "util/BFloat16.h" ,
93
+ "util/BFloat16-inl.h" ,
94
+ "util/BFloat16-math.h" ,
95
+ "util/Half.h" ,
96
+ "util/Half-inl.h" ,
97
+ "util/TypeSafeSignMath.h" ,
98
+ "util/bit_cast.h" ,
99
+ "util/complex.h" ,
100
+ "util/complex_math.h" ,
101
+ "util/complex_utils.h" ,
102
+ "util/floating_point_utils.h" ,
103
+ "util/irange.h" ,
104
+ ],
105
+ exported_preprocessor_flags = [
106
+ "-DC10_USING_CUSTOM_GENERATED_MACROS" ,
107
+ ] + ([] if runtime .is_oss else [
108
+ "-DC10_USE_GLOG" ,
109
+ "-DC10_USE_MINIMAL_GLOG" ,
110
+ ]),
111
+ visibility = [
112
+ "//executorch/..." ,
113
+ "@EXECUTORCH_CLIENTS" ,
114
+ ],
115
+ deps = select ({
116
+ "DEFAULT" : [],
117
+ # Half-inl.h depends on vec_half.h from ATen, but only when building for x86.
118
+ "ovr_config//cpu:x86_64" : [
119
+ ":aten_headers_for_executorch" ,
120
+ ],
121
+ }),
122
+ )
123
+ else :
124
+ runtime .cxx_library (
125
+ name = "c10" ,
126
+ exported_deps = [":aten_headers_for_executorch" ],
127
+ visibility = [
128
+ "//executorch/..." ,
129
+ "@EXECUTORCH_CLIENTS" ,
130
+ ],
131
+ )
0 commit comments