| commit | 4c772649d06de31c1ad2e17bb2951f84a3006a59 | [log] [tgz] |
|---|---|---|
| author | Lukasz Anforowicz <lukasza@google.com> | Mon May 30 11:11:02 2022 -0700 |
| committer | Copybara-Service <copybara-worker@google.com> | Mon May 30 11:11:30 2022 -0700 |
| tree | 0103c4d45c2587cdb4a5b6208dd99bd05a6f4f2c | |
| parent | ff16f6442cb78ae79ab61bd3b6375480f6af28b3 [diff] |
Bazel support: Replace `PREBUILT_LLVM_PATH` with `LLVM_INSTALL_PATH`.
Pre-built LLVM+Clang libraries+headers can be found either at:
1. LLVM's source path (`PREBUILT_LLVM_PATH`) *and* build path
`"${PREBUILT_LLVM_PATH}/${CMAKE_BUILD_DIR}"` taken together, or
2. LLVM's install path (`LLVM_INSTALL_PATH`)
This CL switches from the former to the latter approach because:
1. Bazel's `glob` doesn't like dealing with `..` or absolute paths
(and Chromium places LLVM's build directory outside of LLVM's
source directory).
2. It slightly simplifies Crubit's BUILD files (see the changes
in this CL).
PiperOrigin-RevId: 451898842
Extremely experimental interop tooling for C++ and Rust.
Please don‘t use, this is an experiment and we don’t yet know where will it take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.
$ apt install clang lld bazel $ git clone git@github.com:google/crubit.git $ cd crubit $ bazel build --linkopt=-fuse-ld=/usr/bin/ld.lld //rs_bindings_from_cc:rs_bindings_from_cc_impl
$ git clone https://github.com/llvm/llvm-project $ cd llvm-project $ CC=clang CXX=clang++ cmake -S llvm -B build -DLLVM_ENABLE_PROJECTS='clang' -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install $ cmake --build build -j $ # wait... $ cmake --install build $ cd ../crubit $ LLVM_INSTALL_PATH=../llvm-project/install bazel build //rs_bindings_from_cc:rs_bindings_from_cc_impl