Skip to content

Commit 11bc3d4

Browse files
authored
[Windows] don't use invalid flags on Windows (#8915)
don't use invalid flags on windows
1 parent 95f779a commit 11bc3d4

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

backends/vulkan/targets.bzl

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "CXX", "FBCODE"
55

66

77
def get_vulkan_compiler_flags():
8-
return ["-Wno-missing-prototypes", "-Wno-global-constructors"]
8+
return select({
9+
"DEFAULT": [
10+
"-Wno-global-constructors",
11+
"-Wno-missing-prototypes",
12+
],
13+
"ovr_config//os:windows": [],
14+
})
915

1016
def get_labels(no_volk):
1117
if no_volk:

runtime/core/named_data_map.h

+5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
*/
88

99
#pragma once
10+
11+
#ifdef __GNUC__
1012
// Disable -Wdeprecated-declarations, as some builds use 'Werror'.
1113
#pragma GCC diagnostic push
1214
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
15+
#endif
1316

1417
#include <executorch/runtime/core/exec_aten/exec_aten.h>
1518
#include <executorch/runtime/core/freeable_buffer.h>
@@ -78,4 +81,6 @@ class ET_EXPERIMENTAL NamedDataMap {
7881
} // namespace runtime
7982
} // namespace executorch
8083

84+
#ifdef __GNUC__
8185
#pragma GCC diagnostic pop
86+
#endif

runtime/executor/method.h

+5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
*/
88

99
#pragma once
10+
11+
#ifdef __GNUC__
1012
// Disable -Wdeprecated-declarations, as some builds use 'Werror'.
1113
#pragma GCC diagnostic push
1214
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
15+
#endif
1316

1417
#include <executorch/runtime/core/evalue.h>
1518
#include <executorch/runtime/core/event_tracer.h>
@@ -402,4 +405,6 @@ using ::executorch::runtime::Method;
402405
} // namespace executor
403406
} // namespace torch
404407

408+
#ifdef __GNUC__
405409
#pragma GCC diagnostic pop
410+
#endif

runtime/executor/program.h

+5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
*/
88

99
#pragma once
10+
11+
#ifdef __GNUC__
1012
// Disable -Wdeprecated-declarations, as some builds use 'Werror'.
1113
#pragma GCC diagnostic push
1214
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
15+
#endif
1316

1417
#include <cinttypes>
1518
#include <cstdint>
@@ -315,4 +318,6 @@ using ::executorch::runtime::Program;
315318
} // namespace executor
316319
} // namespace torch
317320

321+
#ifdef __GNUC__
318322
#pragma GCC diagnostic pop
323+
#endif

runtime/executor/tensor_parser.h

+6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
*/
88

99
#pragma once
10+
11+
#ifdef __GNUC__
1012
// Disable -Wdeprecated-declarations, as some builds use 'Werror'.
1113
#pragma GCC diagnostic push
1214
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
15+
#endif
1316

1417
#include <executorch/runtime/core/evalue.h>
1518
#include <executorch/runtime/core/exec_aten/exec_aten.h>
@@ -154,4 +157,7 @@ using ::executorch::runtime::deserialization::parseTensorList;
154157
} // namespace deserialization
155158
} // namespace executor
156159
} // namespace torch
160+
161+
#ifdef __GNUC__
157162
#pragma GCC diagnostic pop
163+
#endif

0 commit comments

Comments
 (0)