tree: cdbf48d5062f87c5df044e1e18e3ccc5e0e59521 [path history] [tgz]
  1. bazel_support/
  2. support/
  3. test/
  4. util/
  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. ffi_types.cc
  15. ffi_types.h
  16. ffi_types.rs
  17. frontend_action.cc
  18. frontend_action.h
  19. importer.cc
  20. importer.h
  21. importer_test.cc
  22. ir.cc
  23. ir.h
  24. ir.rs
  25. ir_from_cc.cc
  26. ir_from_cc.h
  27. ir_from_cc_test.rs
  28. ir_testing.rs
  29. json_from_cc.cc
  30. README.md
  31. rs_bindings_from_cc.cc
  32. src_code_gen.cc
  33. src_code_gen.h
  34. src_code_gen.rs
  35. token_stream_matchers.rs
  36. token_stream_printer.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 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