logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

cxxbridge - generate C++ code from rust source files

Author

       Matthias Geiger <werdahias@debian.org>

Description

Usage:
       cxxbridge <input>.rs
              Emit .cc file for bridge to stdout

       cxxbridge <input>.rs --header
              Emit .h file for bridge to stdout

       cxxbridge --header
              Emit "rust/cxx.h" header to stdout

   Arguments:
              [input]

              Input Rust source file containing #[cxx::bridge].

Name

       cxxbridge - generate C++ code from rust source files

Options

--cfg <name="value" | name[=true] | name=false>

              Compilation configuration matching what will be used to build the Rust side of the bridge.

       --cxx-impl-annotations <annotation>

              Optional  annotation for implementations of C++ function wrappers that may be exposed to Rust. You
              may for example need to provide __declspec(dllexport) or __attribute__((visibility("default"))) if
              Rust code from one shared object or executable depends on these C++ functions in another.

       --header

              Emit header with declarations only. Optional if using `-o` with a path ending in `.h`.

       --help

              Print help information.

       -i, --include <include>

              Any additional headers to #include. The cxxbridge tool does not parse or even  require  the  given
              paths to exist; they simply go into the generated C++ code as #include lines.

       -o, --output <output>

              Path of file to write as output. Output goes to stdout if -o is not specified.

       --version

              Print version information.

See Also