The Wayback Machine - https://web.archive.org/web/20201107155644/https://github.com/google/llvm-bazel
Skip to content
main
Go to file
Code

Latest commit

Notably, all of the `-Iexternal/...` tricks are gone through the careful
application of extra entries in `srcs` to enable
file-relative-inclusion, and special header-only libraries which
re-expose header files with the desired prefixes using combinations of
`strip_include_prefix` and in one case `include_prefix`.

The result likely has some missing dependencies that will only be
detected if we enable header parsing in the future. I didn't want to try
to figure those out from scratch in every case without the tooling to
tell me if I'm wrong.

There are also still places where we should be doing intentional textual
headers, but cannot due to the Bazel bug that prevents
`strip_include_prefix` from working with them. I've left appropriate
comments about fixing those.

Even with the workarounds required here, I think this is a positive
step, and I don't really want to block on cleaning up all the code that
this copes with.

I also had to fix some of the build issues with the `llvm-exegesis`
stuff that I hadn't noticed before in order to test all of this, but
I did and that's included. The unittests and everything for that builds
now if you happen to have the correct stuff installed locally.
32882c7

Git stats

Files

Permalink
Failed to load latest commit information.

README.md

LLVM Bazel BUILD files

DISCLAIMER: This is not an officially-supported Google project and is still in development.

This repo contains standalone Bazel BUILD configuration for part of the LLVM project that could be shared by dependent projects using the Bazel build system.

It is similar to the BUILD files for LLVM and MLIR in the TensorFlow project, but aims to be suitable for more general usage.

Status

MLIR has Cuda support and the mlir-vulkan-runner disabled. LLVM does not yet have configuration detection and hardcodes values in the config.

Usage

These build files are flexible in how they can be used. The llvm-bazel subdirectory has the simplest build configuration with a submodule for the llvm-project. The WORKSPACE is in that directory, so you can build the project like:

cd llvm-bazel/
bazel build --config=generic_clang @llvm-project//...

Users are more likely going to want to fetch build files from this repository and use them with their own copy of the llvm-project.

The http-archive-demo branch shows a build based on http_archive.

The submodule-demo branch shows usage of these build files with both them and llvm-project coming from submodules.

You can build either of these demos after changing into the respective directory with a command like

bazel build --config=generic_clang @llvm-project//...

License

Licensed under the Apache license with LLVM Exceptions. See LICENSE for more information.

You can’t perform that action at this time.