inflation / vapoursynth4-rs

A safe wrapper for Vapoursynth v4 API
6 stars 2 forks source link

Support not linking against libvapoursynth #2

Closed jsaowji closed 4 months ago

jsaowji commented 1 year ago

For building a vapoursynth plugin under msys2 i needed to force it to not link against the vapoursynth library like this.

https://github.com/jsaowji/vapoursynth4-rs/commit/c01cf9cc88745199c75cbc73d8a956ef0223331d

This commit is obviously a big hack, but since the plugin .dlls I looked at also don't link against vapoursynth it should be supported i think.

inflation commented 1 year ago

Sure thing. Fixed in cd0c189.

jsaowji commented 1 year ago

Thanks for the quick response however it doesn't work for me. mingw for some reason still tries to link against getVapourSynthAPI even though it is unused. I know it somehow optimizes it out and does not link against it, on linux. In my commit I commented those calls out too, but forgot to mention it. Since I mainly use linux and dont really know if there are any flags i can pass to mingw to make it match linux behavior.

The original vapoursynth-rs seems to restrict the usage of getVapourSynthAPI behind the linking feature flag, maybe that is the proper solution.

Anyway much thanks for this crate.

inflation commented 1 year ago

I don't know. The linking stuff in build.rs is gated behind a feature flag. Rust shouldn't care about FFI functions, unless maybe cross-language LTO. Please show me your build command and output.

jsaowji commented 1 year ago

Simplest thing i can say is just doing cargo build in the sample-plugin folder gives the error for me on windows. https://gist.github.com/jsaowji/98dcfc78b32ec168c2314c3318d5abe1

Those other stuff might indicate something wrong with my installation but haven't investigated that. But also double checked that on my fork with commented out getVapourSynthAPI that sample_plugin build and loads fine in vapoursynth.