From abb1d78a74fd7481433eced17d1b6a1c1fa93c64 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 18 Nov 2024 13:49:15 -0500 Subject: [PATCH] Support building the C library with cargo-c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See “If you plan to keep the bindings as a separate crate and do not need to autogenerate the headers…” in https://github.com/lu-zero/cargo-c/tree/dd97c89dc40892b84583ed93e028124a78dc3dc3?tab=readme-ov-file#the-tldr. Building with cargo-c is beneficial for Linux distributions in particular because it correctly handles ABI/SONAME versioning and produces pkg-config files. --- crates/capi/Cargo.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/capi/Cargo.toml b/crates/capi/Cargo.toml index a59a768..c6ba8c4 100644 --- a/crates/capi/Cargo.toml +++ b/crates/capi/Cargo.toml @@ -14,3 +14,12 @@ crate-type = ["staticlib", "cdylib"] [dependencies] rustc-demangle = { version = "0.1.16", path = "../.." } + +[features] +capi = [] + +[package.metadata.capi.header] +generation = false + +[package.metadata.capi.install.include] +asset = [{ from="include/rustc_demangle.h" }]