cargo-c icon indicating copy to clipboard operation
cargo-c copied to clipboard

Easier onboarding of projects that have custom header file?

Open kornelski opened this issue 1 year ago • 3 comments

cargo-c by default wants to generate a header using cbindgen. The note about generate = false in the readme is easy to overlook.

Could cargo-c be smart about this, and try to detect presence of a hand-made header (*.h or include/*.h), and instruct user to add appropriate bits to Cargo.toml?

kornelski avatar Dec 05 '24 02:12 kornelski

Adding an init command that looks for .h and acts accordingly (populate a cbindgen.toml or add generate = false and add the .h in the metadata if they are in a custom place?

lu-zero avatar Dec 05 '24 06:12 lu-zero

Yes, that could work.

I've noticed that it already creates cbindgen config automatically. Maybe if there's no cbindgen config, it should search for .h files, and warn or ask or skip cbindgen if headers are found?

kornelski avatar Dec 06 '24 01:12 kornelski

right now there is no init command, getting it nice might time a bit of time and quite a bit of toml-edit ^^;

lu-zero avatar Dec 06 '24 08:12 lu-zero