rsmpeg icon indicating copy to clipboard operation
rsmpeg copied to clipboard

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

Open vcup opened this issue 1 year ago • 3 comments

This way has serval benefits, for example.

  • IDE syncing support
  • support relative path than can be work everywhere
  • repository embeded configuration

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

vcup avatar Feb 04 '24 03:02 vcup

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

ldm0 avatar Feb 04 '24 04:02 ldm0

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

gezihuzi avatar Feb 13 '24 11:02 gezihuzi

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" }

vnghia avatar Mar 16 '24 08:03 vnghia