cxx
cxx copied to clipboard
Duplicaste String, Slice etc in cxx.h, and lib.rs.h
in using multiple bridge files,
some classes are redundant.
it's surrounded by CXXBRIDGE1_RUST_STRING
etc.
is it possible to remove this redundancy?
If you're using cxxbridge
to generate lib.rs.h
, you need to add the flag --include rust/cxx.h
which will notify cxxbridge
that you have this header available and not duplicate the definitions in the generated headers or source files.
I stumbled on this issue and have basically the same need. I'm confused by the answer though -- where exactly do I put this flag?
I tried:
cxx_build::bridge(&filename)
.flag("--include rust/cxx.h")
.flag_if_supported("-std=c++17")
.compile(name.as_str());
...and that didn't work. So I'm missing something...