aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2017-05-30 12:39:13 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-05-30 12:52:01 +0200
commitc7696b47a4a12b1e56e41246770cbd44ad1c9c3e (patch)
tree52d6a01d914ea1aa08c3f25ffee02572c2a80c8e /src
parentaea56b36af994b269800602e36000c293cabd00b (diff)
Make Bazel build without --cpu=x64_windows_msvc
After this change, with a Bazel having MSVC as default toolchain, the command to build a MSVC Bazel on Windows is simply: bazel build //src:bazel although bazel build --cpu=x64_windows_msvc //src:bazel is still supported. And the command to build a MSYS Bazel on Windows is: bazel build --cpu=x64_windows_msys //src:bazel Also made //src/test/cpp:blaze_util_test pass without --cpu=x64_windows_msvc Change-Id: Iaf37513c778768d06fb5700442d5229a5f348964 PiperOrigin-RevId: 157446905
Diffstat (limited to 'src')
-rw-r--r--src/main/cpp/BUILD15
-rw-r--r--src/main/tools/BUILD3
-rw-r--r--src/test/cpp/BUILD1
3 files changed, 12 insertions, 7 deletions
diff --git a/src/main/cpp/BUILD b/src/main/cpp/BUILD
index 632fd791a3..ed8ea20085 100644
--- a/src/main/cpp/BUILD
+++ b/src/main/cpp/BUILD
@@ -4,6 +4,13 @@ package(
default_visibility = ["//visibility:public"],
)
+WIN_LINK_OPTS = [
+ "-Wl,advapi32.lib", # GetUserNameW
+ "-Wl,ole32.lib", # CoTaskMemFree
+ "-Wl,shell32.lib", # SHGetKnownFolderPath
+ "-Wl,ws2_32.lib", # grpc
+]
+
cc_library(
name = "blaze_util",
srcs = [
@@ -50,12 +57,8 @@ cc_library(
],
"//src:freebsd": [
],
- "//src:windows_msvc": [
- "-Wl,advapi32.lib", # GetUserNameW
- "-Wl,ole32.lib", # CoTaskMemFree
- "-Wl,shell32.lib", # SHGetKnownFolderPath
- "-Wl,ws2_32.lib", # grpc
- ],
+ "//src:windows": WIN_LINK_OPTS,
+ "//src:windows_msvc": WIN_LINK_OPTS,
"//conditions:default": [
"-lrt",
],
diff --git a/src/main/tools/BUILD b/src/main/tools/BUILD
index 72aff6301f..260c0edce6 100644
--- a/src/main/tools/BUILD
+++ b/src/main/tools/BUILD
@@ -16,6 +16,7 @@ cc_library(
cc_binary(
name = "process-wrapper",
srcs = select({
+ "//src:windows": ["process-wrapper-windows.cc"],
"//src:windows_msvc": ["process-wrapper-windows.cc"],
"//conditions:default": [
"process-wrapper.cc",
@@ -23,6 +24,7 @@ cc_binary(
}),
linkopts = ["-lm"],
deps = select({
+ "//src:windows": [],
"//src:windows_msvc": [],
"//conditions:default": [
":process-tools",
@@ -34,6 +36,7 @@ cc_binary(
cc_binary(
name = "build-runfiles",
srcs = select({
+ "//src:windows": ["build-runfiles-windows.cc"],
"//src:windows_msvc": ["build-runfiles-windows.cc"],
"//conditions:default": ["build-runfiles.cc"],
}),
diff --git a/src/test/cpp/BUILD b/src/test/cpp/BUILD
index 6278f5bef7..263c3d1a45 100644
--- a/src/test/cpp/BUILD
+++ b/src/test/cpp/BUILD
@@ -12,7 +12,6 @@ cc_test(
name = "blaze_util_test",
srcs = select({
"//src:windows": [
- "blaze_util_test.cc",
"blaze_util_windows_test.cc",
],
"//src:windows_msys": [