|
1 | 1 | # Description: |
2 | 2 | # Brotli is a generic-purpose lossless compression algorithm. |
3 | 3 |
|
4 | | -# Build file is the same as in brotli, but with STRICT_C_OPTIONS disabled as elaborated below. |
5 | | - |
6 | 4 | load(":compiler_config_setting.bzl", "create_msvc_config") |
7 | 5 |
|
8 | 6 | package( |
@@ -43,24 +41,41 @@ config_setting( |
43 | 41 | visibility = ["//visibility:public"], |
44 | 42 | ) |
45 | 43 |
|
| 44 | +config_setting( |
| 45 | + name = "clang-cl", |
| 46 | + values = {"compiler": "clang-cl"}, |
| 47 | + visibility = ["//visibility:public"], |
| 48 | +) |
| 49 | + |
46 | 50 | create_msvc_config() |
47 | 51 |
|
48 | | -# Disable strict C options, rely on workerd-level warnings instead |
49 | 52 | STRICT_C_OPTIONS = select({ |
50 | 53 | ":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 | + ], |
51 | 67 | "//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", |
64 | 79 | ], |
65 | 80 | }) |
66 | 81 |
|
@@ -128,6 +143,7 @@ cc_library( |
128 | 143 | hdrs = [":enc_headers"], |
129 | 144 | copts = STRICT_C_OPTIONS, |
130 | 145 | linkopts = select({ |
| 146 | + ":clang-cl": [], |
131 | 147 | ":msvc": [], |
132 | 148 | "//conditions:default": ["-lm"], |
133 | 149 | }), |
|
0 commit comments