Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CXX_RS_EXPORT, CXX_CPP_EXPORT macros to cxx.cc #1025

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion gen/cmd/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ 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.";
these C++ functions in another.

If you need to use this option, you might also consider similarly
defining either or both of the preprocessor symbols CXX_RS_EXPORT
and CXX_CPP_EXPORT when compiling cxx.cc. CXX_RS_EXPORT
attaches to symbols exported from cxx.cc which are typically used
by Rust code; CXX_CPP_EXPORT attaches to symbols which are used
by C++ code.
";
Arg::new(CXX_IMPL_ANNOTATIONS)
.long(CXX_IMPL_ANNOTATIONS)
.takes_value(true)
Expand Down
7 changes: 7 additions & 0 deletions gen/cmd/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ OPTIONS:
__declspec(dllexport) or __attribute__((visibility(\"default\")))
if Rust code from one shared object or executable depends on
these C++ functions in another.

If you need to use this option, you might also consider similarly
defining either or both of the preprocessor symbols CXX_RS_EXPORT
and CXX_CPP_EXPORT when compiling cxx.cc. CXX_RS_EXPORT
attaches to symbols exported from cxx.cc which are typically used
by Rust code; CXX_CPP_EXPORT attaches to symbols which are used
by C++ code.

-h, --help
Print help information.
Expand Down