[Bazel] Detect Windows with cpu value x64_windows and x64_windows_msvc

and x64_windows_msvc
This commit is contained in:
Loo Rong Jie
2018-01-07 22:52:52 +08:00
parent c3bb0ee2a6
commit cbd15d417e
3 changed files with 18 additions and 7 deletions

View File

@@ -37,7 +37,12 @@ package(default_visibility = ["//visibility:public"])
licenses(["notice"])
config_setting(
name = "win",
name = "windows",
values = { "cpu": "x64_windows" },
)
config_setting(
name = "windows_msvc",
values = {"cpu": "x64_windows_msvc"},
)
@@ -65,7 +70,8 @@ cc_library(
]),
copts = select(
{
":win": [],
":windows": [],
":windows_msvc": [],
"//conditions:default": ["-pthread"],
},
),
@@ -76,7 +82,8 @@ cc_library(
"googletest/include",
],
linkopts = select({
":win": [],
":windows": [],
":windows_msvc": [],
"//conditions:default": [
"-pthread",
],