larksuite / rsmpeg

A Rust crate that exposes FFmpeg's power as much as possible.
https://docs.rs/rsmpeg/latest/rsmpeg/
MIT License
677 stars 41 forks source link

Document improve: use .cargo/config.toml to set env #152

Open vcup opened 10 months ago

vcup commented 10 months ago

This way has serval benefits, for example.

config.toml look like below.

[env]
FFMPEG_PKG_CONFIG_PATH = { value = "target/vcpkg/installed/x64-linux/lib/pkgconfig", relative = true }

useful links: .cargo/config.toml section detail thread on stackoverflow

ldm0 commented 10 months ago

Thanks for your information. I'll enhance the doc later.

gezihuzi commented 9 months ago

Currently, [env] in config.toml does not support specifying os and arch.

https://github.com/rust-lang/cargo/issues/10273 https://github.com/rust-lang/cargo/issues/10789

vnghia commented 8 months ago

You can use feature link_system_ffmpeg which will use pkg-config to find the ffmpeg https://github.com/CCExtractor/rusty_ffmpeg/blob/1c6a1f58355cdd22248f534f32b6bc143f8ffde4/build.rs#L409-L411 and set

[env]
PKG_CONFIG_PATH_x86_64-unknown-linux-gnu = { value = "target/vcpkg/installed/x64-linux-release/lib/pkgconfig", relative = true }

PKG_CONFIG_PATH_x86_64-apple-darwin = { value = "target/vcpkg/installed/x64-osx-release/lib/pkgconfig", relative = true }
PKG_CONFIG_PATH_aarch64-apple-darwin = { value = "target/vcpkg/installed/arm64-osx-release/lib/pkgconfig", relative = true }

On Windows, set

[env]
# Only Windows uses vcpkg linking.
VCPKG_ROOT = { value = "target/vcpkg", relative = true }
VCPKGRS_TRIPLET = { value = "x64-windows-static-release" }