aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bazelrc6
-rw-r--r--BUILD.bazel9
2 files changed, 15 insertions, 0 deletions
diff --git a/.bazelrc b/.bazelrc
index 719f4727..9da24e4e 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,4 +1,5 @@
build --incompatible_strict_action_env
+build --enable_platform_specific_config
build -c opt
# C/C++
@@ -15,6 +16,11 @@ build:ci --features=layering_check
build --java_language_version=8
build --tool_java_language_version=9
+# Windows
+# Only compiles with clang on Windows.
+build:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
+build:windows --extra_execution_platforms=//:x64_windows-clang-cl
+
# Toolchain
build:toolchain --extra_toolchains=@llvm_toolchain//:cc-toolchain-linux,@llvm_toolchain//:cc-toolchain-darwin
build:toolchain --//third_party:toolchain
diff --git a/BUILD.bazel b/BUILD.bazel
index e59b1a21..ebd0f993 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -77,3 +77,12 @@ alias(
"//conditions:default": ":clang",
}),
)
+
+platform(
+ name = "x64_windows-clang-cl",
+ constraint_values = [
+ "@platforms//cpu:x86_64",
+ "@platforms//os:windows",
+ "@bazel_tools//tools/cpp:clang-cl",
+ ],
+)