Skip to content

Commit 86abdbb

Browse files
committed
Cargo: configure cargo-c to use vendored .h
Presently we pre-generate the rustls.h header file using `cbindgen`, commit the result to `src/rustls.h`, and check that the generated result matches the checked-in result in CI. The new experimental cargo-c build regenerates its own header file using `cbindgen` by default unless told to do otherwise. We'd prefer it didn't do this because we're using a `cbindgen` feature that requires nightly rust. This commit updates the `Cargo.toml` capi metadata to tell cargo-c to skip generation of its own header file. We then configure the pre-generated checked-in header file as an asset to be copied into the install include directory. This better matches how the `Makefile` build allowed building the static lib without needing nightly rust or `cbindgen`.
1 parent 2bc49f4 commit 86abdbb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ regex = "1.9.6"
4141
[package.metadata.capi.header]
4242
name = "rustls"
4343
subdirectory = false
44+
generation = false # Prefer a vendored .h
4445

4546
[package.metadata.capi.library]
4647
name = "rustls"
@@ -50,3 +51,6 @@ rustflags = "-Cmetadata=rustls-ffi"
5051
[package.metadata.capi.pkg_config]
5152
name = "rustls"
5253
filename = "rustls"
54+
55+
[package.metadata.capi.install.include]
56+
asset = [{from = "src/rustls.h", to = "" }]

0 commit comments

Comments
 (0)