tree: 803191615f3e02f46c2ec64f03a5a4c69d570dd7 [path history] [tgz]
  1. bazel_support/
  2. support/
  3. test/
  4. ast_consumer.cc
  5. ast_consumer.h
  6. ast_convert.cc
  7. ast_convert.h
  8. bazel_types.h
  9. BUILD
  10. cmdline.cc
  11. cmdline.h
  12. cmdline_test.cc
  13. frontend_action.cc
  14. frontend_action.h
  15. importer.cc
  16. importer.h
  17. importer_test.cc
  18. ir.cc
  19. ir.h
  20. ir.rs
  21. ir_from_cc.cc
  22. ir_from_cc.h
  23. ir_from_cc_test.rs
  24. ir_testing.rs
  25. json_from_cc.cc
  26. README.md
  27. rs_bindings_from_cc.cc
  28. src_code_gen.cc
  29. src_code_gen.h
  30. src_code_gen.rs
  31. token_stream_matchers.rs
rs_bindings_from_cc/README.md

rs_bindings_from_cc

Disclaimer: This project is experimental, under heavy development, and should not be used yet.

:rs_bindings_from_cc parses C++ headers and generates:

  • a Rust source file with bindings for the C++ API
  • a C++ source file with the implementation of the bindings

For convenience, :test_wrapper is a shell script that passes all Clang command line flags from the current Bazel C++ toolchain:

bazel run //rs_bindings_from_cc:test_wrapper -- --public_headers=hello_world.h

or:

bazel build //rs_bindings_from_cc:test_wrapper
bazel-bin/rs_bindings_from_cc/test_wrapper --public_headers=hello_world.h

Testing

If possible follow these recommendations:

To get Rust backtraces for rs_bindings_from_cc when running end-to-end tests, use bazel test --action_env=RUST_BACKTRACE=1 to run the tests.

Contributing

Chat room: https://chat.google.com/room/AAAAImO--WA

20% starter projects list: b/hotlists/3645339