mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.29k stars 294 forks source link

Add no-export in cbindgen.toml config #924

Open tisonkun opened 5 months ago

tisonkun commented 5 months ago

@aidanhs @emilio

I need it for my c binding of OpenDAL and local tests pass with this change.

Let me know if this patch needs some improvement :D

tisonkun commented 4 months ago

It seems that for Style::Tag and Language::C, my work case can pass. But the test coverage also check for other style and language like pyx. The previous no-export attr should share the same issue.

@emilio what would you suggest to write a test? I cannot write a proper test for it but it's the same as when we previously merge "no-export` attr.

emilio commented 3 months ago

It seems that for Style::Tag and Language::C, my work case can pass. But the test coverage also check for other style and language like pyx. The previous no-export attr should share the same issue.

@emilio what would you suggest to write a test? I cannot write a proper test for it but it's the same as when we previously merge "no-export` attr.

For tests, you can include relevant boilerplate using config.header or so to make the test files compile, right? We do that in a bunch of tests.