diff --git a/backends/vulkan/targets.bzl b/backends/vulkan/targets.bzl index 150ae32dfce..d2314d138bf 100644 --- a/backends/vulkan/targets.bzl +++ b/backends/vulkan/targets.bzl @@ -5,7 +5,13 @@ load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "CXX", "FBCODE" def get_vulkan_compiler_flags(): - return ["-Wno-missing-prototypes", "-Wno-global-constructors"] + return select({ + "DEFAULT": [ + "-Wno-global-constructors", + "-Wno-missing-prototypes", + ], + "ovr_config//os:windows": [], + }) def get_labels(no_volk): if no_volk: diff --git a/runtime/core/named_data_map.h b/runtime/core/named_data_map.h index ef5e413db67..e79c7035989 100644 --- a/runtime/core/named_data_map.h +++ b/runtime/core/named_data_map.h @@ -7,9 +7,12 @@ */ #pragma once + +#ifdef __GNUC__ // Disable -Wdeprecated-declarations, as some builds use 'Werror'. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif #include #include @@ -78,4 +81,6 @@ class ET_EXPERIMENTAL NamedDataMap { } // namespace runtime } // namespace executorch +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif diff --git a/runtime/executor/method.h b/runtime/executor/method.h index 4108db8810e..0ca2df440ad 100644 --- a/runtime/executor/method.h +++ b/runtime/executor/method.h @@ -7,9 +7,12 @@ */ #pragma once + +#ifdef __GNUC__ // Disable -Wdeprecated-declarations, as some builds use 'Werror'. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif #include #include @@ -402,4 +405,6 @@ using ::executorch::runtime::Method; } // namespace executor } // namespace torch +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif diff --git a/runtime/executor/program.h b/runtime/executor/program.h index 7313b19d66d..31564dd9177 100644 --- a/runtime/executor/program.h +++ b/runtime/executor/program.h @@ -7,9 +7,12 @@ */ #pragma once + +#ifdef __GNUC__ // Disable -Wdeprecated-declarations, as some builds use 'Werror'. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif #include #include @@ -308,4 +311,6 @@ using ::executorch::runtime::Program; } // namespace executor } // namespace torch +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif diff --git a/runtime/executor/tensor_parser.h b/runtime/executor/tensor_parser.h index 362f0b11e20..1fae84cfb05 100644 --- a/runtime/executor/tensor_parser.h +++ b/runtime/executor/tensor_parser.h @@ -7,9 +7,12 @@ */ #pragma once + +#ifdef __GNUC__ // Disable -Wdeprecated-declarations, as some builds use 'Werror'. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif #include #include @@ -154,4 +157,7 @@ using ::executorch::runtime::deserialization::parseTensorList; } // namespace deserialization } // namespace executor } // namespace torch + +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif