Skip to content

Commit 1c51838

Browse files
committed
Improve brotli windows patch
1 parent fafcc03 commit 1c51838

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

build/BUILD.brotli

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Description:
22
# Brotli is a generic-purpose lossless compression algorithm.
33

4-
# Build file is the same as in brotli, but with STRICT_C_OPTIONS disabled as elaborated below.
5-
64
load(":compiler_config_setting.bzl", "create_msvc_config")
75

86
package(
@@ -43,24 +41,41 @@ config_setting(
4341
visibility = ["//visibility:public"],
4442
)
4543

44+
config_setting(
45+
name = "clang-cl",
46+
values = {"compiler": "clang-cl"},
47+
visibility = ["//visibility:public"],
48+
)
49+
4650
create_msvc_config()
4751

48-
# Disable strict C options, rely on workerd-level warnings instead
4952
STRICT_C_OPTIONS = select({
5053
":msvc": [],
54+
":clang-cl": [
55+
"/W4",
56+
"-Wconversion",
57+
"-Werror",
58+
"-Wextra",
59+
"-Wlong-long",
60+
"-Wmissing-declarations",
61+
"-Wmissing-prototypes",
62+
"-Wno-strict-aliasing",
63+
"-Wshadow",
64+
"-Wsign-compare",
65+
"-Wno-sign-conversion",
66+
],
5167
"//conditions:default": [
52-
# clang-cl does not support --pedantic-errors
53-
# "--pedantic-errors",
54-
# "-Wall",
55-
# "-Wconversion",
56-
# "-Werror",
57-
# "-Wextra",
58-
# "-Wlong-long",
59-
# "-Wmissing-declarations",
60-
# "-Wmissing-prototypes",
61-
# "-Wno-strict-aliasing",
62-
# "-Wshadow",
63-
# "-Wsign-compare",
68+
"--pedantic-errors",
69+
"-Wall",
70+
"-Wconversion",
71+
"-Werror",
72+
"-Wextra",
73+
"-Wlong-long",
74+
"-Wmissing-declarations",
75+
"-Wmissing-prototypes",
76+
"-Wno-strict-aliasing",
77+
"-Wshadow",
78+
"-Wsign-compare",
6479
],
6580
})
6681

@@ -128,6 +143,7 @@ cc_library(
128143
hdrs = [":enc_headers"],
129144
copts = STRICT_C_OPTIONS,
130145
linkopts = select({
146+
":clang-cl": [],
131147
":msvc": [],
132148
"//conditions:default": ["-lm"],
133149
}),

0 commit comments

Comments
 (0)