When compiling I need to do pre- and post-link tasks. Things like adding linker args, changing what's in the output directory, manipulating the final binary, etc.
There doesn't seem to be an easy way to hook in to Cargo so I was wondering if there's a way to do the opposite and tie Cargo into another build system?
I was hoping someone had a ready made solution because it sounds like I'd need to implement a lot myself.
It seems like I'd have to mess was environment variables (being careful of clobbering existing ones) and use something like:
cargo build --message-format json
And parse the json returned to find the final artefacts that are built. Between cargo.toml, .cargo/config and build scripts there are just too many things to take into account manually so I think I'd need to be querying Cargo itself to know what it's actually done.