aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2016-04-19 20:03:10 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-04-20 11:17:03 +0000
commitfdcb3b207a36480f03ab1cbfaf36c5ee4264b806 (patch)
treea1e2d876fb77474cd4b3ece20ac9c65e1782acf9
parent3e862321cda0fa4bb016160f025eca2393cb693b (diff)
Added configuration for wrapper scripts of msvc toolchain
Now we only need to specify --cpu=x64_windows_msvc when using msvc toolchain -- Change-Id: Id501dd9ef2fd6553285677605ec75e80499b9ef7 Reviewed-on: https://bazel-review.googlesource.com/#/c/3441 MOS_MIGRATED_REVID=120260588
-rw-r--r--tools/cpp/BUILD.static29
-rw-r--r--tools/cpp/cc_configure.bzl2
2 files changed, 31 insertions, 0 deletions
diff --git a/tools/cpp/BUILD.static b/tools/cpp/BUILD.static
index 8181a61755..6f5f585ece 100644
--- a/tools/cpp/BUILD.static
+++ b/tools/cpp/BUILD.static
@@ -31,6 +31,7 @@ filegroup(
":cc-compiler-armeabi-v7a",
":cc-compiler-freebsd",
":cc-compiler-x64_windows",
+ ":cc-compiler-x64_windows_msvc",
":empty",
],
)
@@ -76,3 +77,31 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 1,
)
+
+cc_toolchain(
+ name = "cc-compiler-x64_windows_msvc",
+ all_files = ":every-file-x64_windows",
+ compiler_files = ":compile-x64_windows",
+ cpu = "x64_windows",
+ dwp_files = ":empty",
+ dynamic_runtime_libs = [":empty"],
+ linker_files = ":empty",
+ objcopy_files = ":empty",
+ static_runtime_libs = [":empty"],
+ strip_files = ":empty",
+)
+
+filegroup(
+ name = "every-file-x64_windows",
+ srcs = [
+ ":compile-x64_windows",
+ ],
+)
+
+filegroup(
+ name = "compile-x64_windows",
+ srcs = glob([
+ "wrapper/bin/msvc_*",
+ "wrapper/bin/pydir/msvc*",
+ ]),
+) \ No newline at end of file
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index 9e196253ba..f06bcb2b4b 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -289,6 +289,8 @@ def _impl(repository_ctx):
# Windows support is still experimental, let's not fiddle with autoconfiguration for now.
repository_ctx.symlink(Label("@bazel_tools//tools/cpp:CROSSTOOL"), "CROSSTOOL")
repository_ctx.symlink(Label("@bazel_tools//tools/cpp:BUILD.static"), "BUILD")
+ msvc_wrapper = repository_ctx.path(Label("@bazel_tools//tools/cpp:CROSSTOOL")).dirname.get_child("wrapper").get_child("bin")
+ repository_ctx.symlink(msvc_wrapper, "wrapper/bin")
else:
darwin = cpu_value == "darwin"
cc = _find_cc(repository_ctx)