CXXBRIDGE(1)
π CXXBRIDGE(1) π
okay bestie, welcome to the cxxbridge user manual β a.k.a. the lil glow-up machine that turns your Rust source files into C++ code. it's a User Commands type of situation, and it's about to be your new obsession. β¨
πΈ NAME πΈ
cxxbridge β generate C++ code from rust source files π¦
no cap, that's literally the whole job. it reads Rust, it writes C++, and it does it flawlessly. periodt.
β¨ DESCRIPTION β¨
π Usage
here's the vibe check on how you actually run this thing:
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]. yes bestie, that attribute is the whole moment, it's where the magic lives π«
π OPTIONS π
every flag, every crumb, nothing skipped. we love a complete list π
--cfg <name="value" | name[=true] | name=false>β Compilation configuration matching what will be used to build the Rust side of the bridge. like, it has to match fr fr, or the two sides are not on the same page π--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. basically: if your symbols are being shy across shared object boundaries, this is how you tell them to be visible, main character energy only π--headerβ Emit header with declarations only. Optional if using-owith a path ending in.h. it's giving "I only want the receipts, not the implementation" π§--helpβ Print help information. the classic. when in doubt, ask for help, that's not embarrassing, that's iconic π«Ά-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#includelines. so yeah, it trusts you completely. no filesystem check, no drama, it just copies your vibes into the output π-o,--output <output>β Path of file to write as output. Output goes to stdout if-ois not specified. if you don't say where, it just yells it at your terminal πΈ--versionβ Print version information. slay, know your era β
π AUTHOR π
Matthias Geiger <werdahias@debian.org> π
π COPYRIGHT π
Copyright Β© 2025 Matthias Geiger
This manual page was written for the Debian system (and may be used by others).
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 or (at your option) any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
lowkey important: that GPL text path is a real file, bestie, don't go looking for it anywhere else on a Debian system π₯
and that's the whole page, you ate it π
this was cxxbridge version 1.0.137, dated January 2025 β thanks for reading, mwah, see you in the next manpage π¦β¨π
π¦ where this page comes from
- debian trixie: cxxbridge-cmd 1.0.141-1+b1 Β· MIT OR Apache-2.0
- ubuntu questing: cxxbridge-cmd 1.0.141-1
- ubuntu resolute: cxxbridge-cmd 1.0.192-1 Β· MIT OR Apache-2.0
- ubuntu stonking: cxxbridge-cmd 1.0.192-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms