@@ -124,13 +124,22 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
124124 # Zephyr and Windows builds. OSS bypasses the zephyr branch via
125125 # runtime.is_oss since ovr_config//os:zephyr is not in the OSS
126126 # buck2 prelude.
127+ # The vendored ATen vec headers pulled in on the Windows host trip
128+ # several -Werror warnings (e.g. -Wundef on __GNUC__), so disable
129+ # warnings-as-errors for the Windows (clang) kernel compiles.
127130 compiler_flags = (select ({
128131 "DEFAULT" : ["-Wno-missing-prototypes" ],
129- "ovr_config//os:windows" : [],
132+ "ovr_config//os:windows" : select ({
133+ "DEFAULT" : ["-Wno-error" ],
134+ "ovr_config//compiler:msvc" : [],
135+ }),
130136 "ovr_config//os:zephyr" : [],
131137 }) if not runtime .is_oss else select ({
132138 "DEFAULT" : ["-Wno-missing-prototypes" ],
133- "ovr_config//os:windows" : [],
139+ # OSS buck2 has no compiler constraint (ovr_config//compiler:msvc
140+ # resolves to the nonexistent prelude//compiler:msvc), so it
141+ # cannot appear as a select key. Use the clang flag directly.
142+ "ovr_config//os:windows" : ["-Wno-error" ],
134143 })) + (
135144 # For shared library build, we don't want to expose symbols of
136145 # kernel implementation (ex torch::executor::native::tanh_out)
0 commit comments