tree: 8d30fc0c68e02092a141cf6dfe8425fc78123be2 [path history] [tgz]
  1. bazel_support/
  2. importers/
  3. support/
  4. test/
  5. ast_consumer.cc
  6. ast_consumer.h
  7. ast_convert.cc
  8. ast_convert.h
  9. bazel_types.h
  10. BUILD
  11. cmdline.cc
  12. cmdline.h
  13. cmdline_test.cc
  14. collect_instantiations.cc
  15. collect_instantiations.h
  16. collect_instantiations.rs
  17. collect_instantiations_test.cc
  18. decl_importer.h
  19. frontend_action.cc
  20. frontend_action.h
  21. generate_bindings_and_metadata.cc
  22. generate_bindings_and_metadata.h
  23. generate_bindings_and_metadata_test.cc
  24. importer.cc
  25. importer.h
  26. importer_test.cc
  27. ir.cc
  28. ir.h
  29. ir.rs
  30. ir_from_cc.cc
  31. ir_from_cc.h
  32. ir_from_cc_test.rs
  33. ir_testing.rs
  34. json_from_cc.cc
  35. README.md
  36. rs_bindings_from_cc.cc
  37. src_code_gen.cc
  38. src_code_gen.h
  39. src_code_gen.rs
  40. 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