bazel-contrib / toolchains_llvm

LLVM toolchain for bazel
Apache License 2.0
296 stars 213 forks source link

feat: windows toolchain for running clang tools #342

Open peakschris opened 3 months ago

peakschris commented 3 months ago

This is a start on windows toolchain support (https://github.com/bazel-contrib/toolchains_llvm/issues/4). Enough is in place for the distribution to be downloaded, extracted, and tools made available through symlinks and a build file.

working examples: bazel run @llvm_toolchain_llvm//:bin/clang-tidy.exe bazel run @llvm_toolchain_llvm//:bin/clang-format.exe

llvm 18+ is required.

Comments, suggestions, help all very welcome

peakschris commented 3 months ago

If you haven't come across it already, #154 may be of interest to you; it uses cc_toolchain_config from @bazel_tools//tools/cpp:windows_cc_toolchain_config.bzl which we'll probably also want to eventually do.

This is a great reference, thank you! I don't understand cross compilation, but could give a go at integrating the windows_cc_toolchain_config to a level where it works on a windows machine. I'd like to do this as a followup PR if that's OK. Maybe someone else could take on the cross compilation aspect, I can see that would be hugely valuable for CI runners.