tree: 693bd5d62b268aaf8ce04ca96f5a65cdc311de2f [path history] [tgz]
  1. support/
  2. test/
  3. ast_consumer.cc
  4. ast_consumer.h
  5. ast_convert.cc
  6. ast_convert.h
  7. ast_visitor.cc
  8. ast_visitor.h
  9. ast_visitor_test.cc
  10. blaze_types.h
  11. ffi_types.cc
  12. ffi_types.h
  13. ffi_types.rs
  14. frontend_action.cc
  15. frontend_action.h
  16. ir.cc
  17. ir.h
  18. ir.rs
  19. ir_from_cc.cc
  20. ir_from_cc.h
  21. ir_from_cc_test.rs
  22. ir_test.cc
  23. ir_testing.rs
  24. json_from_cc.cc
  25. README.md
  26. rs_bindings_from_cc.cc
  27. src_code_gen.cc
  28. src_code_gen.h
  29. src_code_gen.rs
  30. src_code_gen_test.cc
  31. token_stream_matchers.rs
  32. token_stream_printer.rs
rs_bindings_from_cc/README.md

rs_bindings_from_cc

Disclaimer: This project is experimental, under heavy development, and should 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 Blaze 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