File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,4 @@ build:linux --cxxopt='-std=c++14'
5252build --per_file_copt="external/.*zlib.*/.*.c@-Wno-deprecated-non-prototype"
5353
5454build:windows --copt=-Wno-builtin-macro-redefined --host_copt=-Wno-builtin-macro-redefined
55+ build:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl --extra_execution_platforms=//:windows
Original file line number Diff line number Diff line change @@ -15,3 +15,12 @@ filegroup(
1515 "//tools:for_bazel_tests" ,
1616 ],
1717)
18+
19+ platform (
20+ name = "windows" ,
21+ constraint_values = [
22+ "@platforms//cpu:x86_64" ,
23+ "@platforms//os:windows" ,
24+ "@bazel_tools//tools/cpp:clang-cl" ,
25+ ],
26+ )
Original file line number Diff line number Diff line change @@ -72,3 +72,6 @@ single_version_override(
7272 patch_strip = 1 ,
7373 patches = ["//:rules_cc.patch" ],
7474)
75+
76+ cc_configure = use_extension ("@rules_cc//cc:extensions.bzl" , "cc_configure_extension" )
77+ use_repo (cc_configure , "local_config_cc" )
Original file line number Diff line number Diff line change @@ -429,11 +429,11 @@ def _swift_toolchain_impl(ctx):
429429 target_triples .parse (ctx .var .get ("CC_TARGET_TRIPLE" ) or target_system_name ),
430430 )
431431
432- # if "clang" not in cc_toolchain.compiler:
433- # fail("Swift requires the configured CC toolchain to be LLVM (clang). " +
434- # "Either use the locally installed LLVM by setting `CC=clang` in your environment " +
435- # "before invoking Bazel, or configure a Bazel LLVM CC toolchain." +
436- # "The current CC toolchain uses: {}".format(cc_toolchain.compiler))
432+ if "clang" not in cc_toolchain .compiler :
433+ fail ("Swift requires the configured CC toolchain to be LLVM (clang). " +
434+ "Either use the locally installed LLVM by setting `CC=clang` in your environment " +
435+ "before invoking Bazel, or configure a Bazel LLVM CC toolchain." +
436+ "The current CC toolchain uses: {}" .format (cc_toolchain .compiler ))
437437
438438 if ctx .attr .os == "windows" :
439439 swift_linkopts_cc_info = _swift_windows_linkopts_cc_info (
You can’t perform that action at this time.
0 commit comments