aboutsummaryrefslogtreecommitdiffhomepage
path: root/BUILD
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@gmail.com>2018-03-23 15:24:03 -0700
committerGravatar GitHub <noreply@github.com>2018-03-23 15:24:03 -0700
commit2c963d3c24f51c4e5b278bc8f843bcf7221fb790 (patch)
tree4902a6618f79fa127592c5c939f9aca78c9e05b0 /BUILD
parenteff52b1c07ded38ac1d07d73f553e3472e736765 (diff)
parenta6957f2890f9f1fb64828734fd6533f1ecdff328 (diff)
Merge pull request #4413 from pmuetschard/msvc
Don't assume Windows builds use MSVC.
Diffstat (limited to 'BUILD')
-rw-r--r--BUILD19
1 files changed, 6 insertions, 13 deletions
diff --git a/BUILD b/BUILD
index 5bcfc189..a144d728 100644
--- a/BUILD
+++ b/BUILD
@@ -19,15 +19,14 @@ config_setting(
# Protobuf Runtime Library
################################################################################
-WIN_COPTS = [
+MSVC_COPTS = [
"/DHAVE_PTHREAD",
"/wd4018", # -Wno-sign-compare
"/wd4514", # -Wno-unused-function
]
COPTS = select({
- ":windows" : WIN_COPTS,
- ":windows_msvc" : WIN_COPTS,
+ ":msvc" : MSVC_COPTS,
"//conditions:default": [
"-DHAVE_PTHREAD",
"-Wall",
@@ -41,13 +40,8 @@ COPTS = select({
})
config_setting(
- name = "windows",
- values = { "cpu": "x64_windows" },
-)
-
-config_setting(
- name = "windows_msvc",
- values = { "cpu": "x64_windows_msvc" },
+ name = "msvc",
+ values = { "compiler": "msvc-cl" },
)
config_setting(
@@ -57,11 +51,10 @@ config_setting(
},
)
-# Android and Windows builds do not need to link in a separate pthread library.
+# Android and MSVC builds do not need to link in a separate pthread library.
LINK_OPTS = select({
":android": [],
- ":windows": [],
- ":windows_msvc": [],
+ ":msvc": [],
"//conditions:default": ["-lpthread", "-lm"],
})