mirror of
https://github.com/google/brotli.git
synced 2024-11-21 19:20:09 +00:00
Add support for clang-cl compiler (#1021)
This commit is contained in:
parent
50ebce107f
commit
534076fa67
12
BUILD
12
BUILD
@ -45,6 +45,17 @@ create_msvc_config()
|
||||
|
||||
STRICT_C_OPTIONS = select({
|
||||
":msvc": [],
|
||||
":clang-cl": [
|
||||
"/W4",
|
||||
"-Wconversion",
|
||||
"-Wlong-long",
|
||||
"-Wmissing-declarations",
|
||||
"-Wmissing-prototypes",
|
||||
"-Wno-strict-aliasing",
|
||||
"-Wshadow",
|
||||
"-Wsign-compare",
|
||||
"-Wno-sign-conversion",
|
||||
],
|
||||
"//conditions:default": [
|
||||
"--pedantic-errors",
|
||||
"-Wall",
|
||||
@ -124,6 +135,7 @@ cc_library(
|
||||
hdrs = [":enc_headers"],
|
||||
copts = STRICT_C_OPTIONS,
|
||||
linkopts = select({
|
||||
":clang-cl": [],
|
||||
":msvc": [],
|
||||
"//conditions:default": ["-lm"],
|
||||
}),
|
||||
|
@ -13,6 +13,13 @@ def create_msvc_config():
|
||||
# flag_values{"@bazel_tools//tools/cpp:compiler"} and the else branch can
|
||||
# be removed.
|
||||
if hasattr(cc_common, "do_not_use_tools_cpp_compiler_present"):
|
||||
native.config_setting(
|
||||
name = "clang-cl",
|
||||
flag_values = {
|
||||
"@bazel_tools//tools/cpp:compiler": "clang-cl",
|
||||
},
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
native.config_setting(
|
||||
name = "msvc",
|
||||
flag_values = {
|
||||
@ -21,6 +28,11 @@ def create_msvc_config():
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
else:
|
||||
native.config_setting(
|
||||
name = "clang-cl",
|
||||
values = {"compiler": "clang-cl"},
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
native.config_setting(
|
||||
name = "msvc",
|
||||
values = {"compiler": "msvc-cl"},
|
||||
|
Loading…
Reference in New Issue
Block a user