meh / rust-ffmpeg

Safe FFmpeg wrapper.
Do What The F*ck You Want To Public License
460 stars 96 forks source link

Disabling libraries while building ffmpeg statically #120

Open AdamBrouwersHarries opened 5 years ago

AdamBrouwersHarries commented 5 years ago

I'd quite like to use rust-ffmpeg for a small project of mine, for which I'd need to build and link ffmpeg statically. As far as I understand it, the included build.rs supports this. I only need a couple of formats (mp3, flac, and pcmf32le) for my purposes, so I was wondering if there is any way to disable the other libraries that the static build links (e.g. ssh) in order to reduce the dependencies, and size of the resulting library.

From reading through the build.rs, it seems that there is a way, but I can't quite figure out how to do it...

Thanks!

AdamBrouwersHarries commented 5 years ago

As far as I can work out, the statically linked libraries are determined by cargo features. I've experimented with disabling them, to no luck. What's more, if I run cargo and disable default features (--no-default-features), then the rust-ffmpeg-sys build script panics (which is to be expected), but still prints linker flags. As far as I can tell, there doesn't seem to be a way to disable the linker flags.