This is an archive of the discontinued LLVM Phabricator instance.

Teach Bazel build for //clang to work on Windows.
AbandonedPublic

Authored by chandlerc on Oct 24 2021, 10:00 PM.

Details

Reviewers
jdoerfert
Summary

This required substantially more invasive changes I'm afraid.

First, there is an issue with a Clang header that isn't really robust on Windows unless you get the includes *just* right. I've reworked it to be a bit more defensive.

Second, I needed a different approach to get libclang working well. This, IMO, improves things on all platforms. Now we build the plugin and actually wrap it back up with cc_import. We have to use a collection of manually tagged cc_binary rules to get the naming to work out the right way, but this isn't too different from the prior approach. By directly having a cc_binary rule for each platform spelling of libclang, we can actually extract the interface library from it and correctly depend on it with cc_import. I think the result now is much closer to the intent and to the CMake build for libclang.

Last but not least, some tests needed disabling. This is actually narrower than what CMake does. The issue isn't indicative of anything serious -- the test just assumes Unix-style paths.

Diff Detail

Event Timeline

chandlerc created this revision.Oct 24 2021, 10:00 PM
chandlerc requested review of this revision.Oct 24 2021, 10:00 PM
chandlerc abandoned this revision.Oct 24 2021, 10:01 PM

Sigh. The Bazel bits seem to break the automatic adding of lists. Ignore, I'll create a fresh revision with lists....