I have a project which I'd like to produce a binary with a statically linked CRT. The Internet(tm) states that one should edit
~/.cargo/config to include:
[target.i686-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"] [target.x86_64-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"]
But this is a global change; I want to hardcode it in this one create.
I get why it's designed the way it is -- it should be up to the person building the crate to decide what CRT to link into the binary, but I have this one specific case where it makes sense to force static CRT within the crate itself.
Hm. The more I think about it, the more I realize why it's a bad idea to allow crates themselves to force a static CRT. Still wondering if there's a way though.