Unverified Commit 2c963d3c authored by Adam Cozzette's avatar Adam Cozzette Committed by GitHub

Merge pull request #4413 from pmuetschard/msvc

Don't assume Windows builds use MSVC.
parents eff52b1c a6957f28
...@@ -19,15 +19,14 @@ config_setting( ...@@ -19,15 +19,14 @@ config_setting(
# Protobuf Runtime Library # Protobuf Runtime Library
################################################################################ ################################################################################
WIN_COPTS = [ MSVC_COPTS = [
"/DHAVE_PTHREAD", "/DHAVE_PTHREAD",
"/wd4018", # -Wno-sign-compare "/wd4018", # -Wno-sign-compare
"/wd4514", # -Wno-unused-function "/wd4514", # -Wno-unused-function
] ]
COPTS = select({ COPTS = select({
":windows" : WIN_COPTS, ":msvc" : MSVC_COPTS,
":windows_msvc" : WIN_COPTS,
"//conditions:default": [ "//conditions:default": [
"-DHAVE_PTHREAD", "-DHAVE_PTHREAD",
"-Wall", "-Wall",
...@@ -41,13 +40,8 @@ COPTS = select({ ...@@ -41,13 +40,8 @@ COPTS = select({
}) })
config_setting( config_setting(
name = "windows", name = "msvc",
values = { "cpu": "x64_windows" }, values = { "compiler": "msvc-cl" },
)
config_setting(
name = "windows_msvc",
values = { "cpu": "x64_windows_msvc" },
) )
config_setting( config_setting(
...@@ -57,11 +51,10 @@ 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({ LINK_OPTS = select({
":android": [], ":android": [],
":windows": [], ":msvc": [],
":windows_msvc": [],
"//conditions:default": ["-lpthread", "-lm"], "//conditions:default": ["-lpthread", "-lm"],
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment