Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion backends/vulkan/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ def get_vulkan_compiler_flags():
"-Wno-global-constructors",
"-Wno-missing-prototypes",
],
"ovr_config//os:windows": [],
# The Windows clang host build needs -Werror relaxed for the vendored
# VMA headers, but MSVC cl.exe rejects the gcc-style flag, so exclude
# pure MSVC. OSS buck2 has no compiler constraint, so guard to non-OSS.
"ovr_config//os:windows": select({
"DEFAULT": ["-Wno-error"],
"ovr_config//compiler:msvc": [],
}) if not runtime.is_oss else ["-Wno-error"],
})

def get_vulkan_preprocessor_flags(no_volk, is_fbcode):
Expand Down
12 changes: 12 additions & 0 deletions kernels/optimized/cpu/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ def define_common_targets():
srcs = ["binary_ops.cpp"],
exported_headers = ["binary_ops.h"],
visibility = ["PUBLIC"],
# ATen vec headers trip -Werror warnings on the Windows clang host;
# MSVC cl.exe rejects the gcc-style flag.
compiler_flags = select({
"DEFAULT": [],
# OSS buck2 has no compiler constraint (ovr_config//compiler:msvc
# resolves to the nonexistent prelude//compiler:msvc), so it cannot
# appear as a select key there; guard the MSVC branch to non-OSS.
"ovr_config//os:windows": select({
"DEFAULT": ["-Wno-error"],
"ovr_config//compiler:msvc": [],
}) if not runtime.is_oss else ["-Wno-error"],
}),
exported_deps = [
"//executorch/runtime/core/exec_aten:lib",
"//executorch/runtime/kernel:kernel_includes",
Expand Down
9 changes: 9 additions & 0 deletions kernels/optimized/lib_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ def define_libs(is_fbcode=False):
# TODO: replace with get_compiler_optimization_flags from op_registration_util.bzl when that
# is re-enabled.
"DEFAULT": ["-Os"],
}) + select({
"DEFAULT": [],
# ATen vec headers trip -Werror warnings on the Windows clang
# host; MSVC cl.exe rejects the gcc-style flag. OSS buck2 has no
# compiler constraint, so guard the MSVC branch to non-OSS.
"ovr_config//os:windows": select({
"DEFAULT": ["-Wno-error"],
"ovr_config//compiler:msvc": [],
}) if not runtime.is_oss else ["-Wno-error"],
}),
header_namespace = "executorch/kernels/optimized",
visibility = ["PUBLIC"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ def define_op_library(name, compiler_flags, deps):
"ovr_config//os:zephyr": [
"-Wno-pass-failed",
],
# The vendored ATen vec headers trip several -Werror warnings on
# the Windows (clang) host, so disable warnings-as-errors there.
"ovr_config//os:windows": select({
"DEFAULT": [
"-Wno-missing-prototypes",
"-Wno-pass-failed",
"-Wno-error",
],
# MSVC cl.exe rejects the gcc-style flags above.
"ovr_config//compiler:msvc": [],
}),
}) if not runtime.is_oss else [
"-Wno-missing-prototypes",
"-Wno-pass-failed",
Expand Down
13 changes: 11 additions & 2 deletions shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,22 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
# Zephyr and Windows builds. OSS bypasses the zephyr branch via
# runtime.is_oss since ovr_config//os:zephyr is not in the OSS
# buck2 prelude.
# The vendored ATen vec headers pulled in on the Windows host trip
# several -Werror warnings (e.g. -Wundef on __GNUC__), so disable
# warnings-as-errors for the Windows (clang) kernel compiles.
compiler_flags = (select({
"DEFAULT": ["-Wno-missing-prototypes"],
"ovr_config//os:windows": [],
"ovr_config//os:windows": select({
"DEFAULT": ["-Wno-error"],
"ovr_config//compiler:msvc": [],
}),
"ovr_config//os:zephyr": [],
}) if not runtime.is_oss else select({
"DEFAULT": ["-Wno-missing-prototypes"],
"ovr_config//os:windows": [],
# OSS buck2 has no compiler constraint (ovr_config//compiler:msvc
# resolves to the nonexistent prelude//compiler:msvc), so it
# cannot appear as a select key. Use the clang flag directly.
"ovr_config//os:windows": ["-Wno-error"],
})) + (
# For shared library build, we don't want to expose symbols of
# kernel implementation (ex torch::executor::native::tanh_out)
Expand Down
Loading