I have been working on some project and started using crates, which is awesome, however all those crates each have some kind of license. Some are MIT, some are MPL, some are GPL, some are Apache, and so on.
The thing is, I might plan to sell my software at some point, so I want to distribute binary blobs. That’s OK, if I only use MIT and BSD type of licenses. As you might guess, GPL-like licenses are a completely different matter. They require me to share my source code if I distribute them in binary form. Bad. Really bad.
So, correct me if I am wrong, but what I think I have to do is compile them and distribute them separately in binary form and just link my executable to the dylibs. That way, the OSS binary files (dylibs) will remain 100% open-source, while I do not have to share the source of my executable application.
How can I go and tell Cargo to build certain dependencies as dylibs? I’d prefer to do so centrally and automatically, if possible. If not, how can I tell Cargo to build a separate crate as dylib and link to the dylib later on?
I already know about crate-type, but I would rather not edit all dependencies individually. That feels hacky and like a lot of trouble!
Thank you for any pointers and corrections!