commit | 73a2c0dc2405b687fea69b64cdaee033da5fb4aa | [log] [tgz] |
---|---|---|
author | Lukasz Anforowicz <lukasza@google.com> | Wed Mar 22 14:07:00 2023 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Mar 22 14:08:09 2023 -0700 |
tree | 8265751872af58da5edd74c90c3d3bbb634b4239 | |
parent | fcf5d5908accc34a4ac05ac87c5bda874fa84a7e [diff] |
Replace `Vec<(SnippetKey, MixedSnippet)>` with `ApiSnippets`. This refactoring seems desirable, because: * The new code explicitly captures that the "main api" consists of a single `CcSnippet`. (The old approach tried to enforce this in the `get_main_api_snippet` test API by `assert!`ing that `snippet.rs.is_empty()` and that there is `exactly_one`.) * The new code simplifies things: * There is no longer a need for `SnippetKind` and `SnippetKey` types. * Some helper functions are no longer needed: `preferred_snippet_order`, `get_main_api_snippet`, `get_impl_details_snippet` PiperOrigin-RevId: 518668403
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