Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vcup opened this issue Feb 4, 2024 · 3 comments
Open

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

vcup opened this issue Feb 4, 2024 · 3 comments

Comments

@vcup
Copy link

vcup commented Feb 4, 2024

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 vcup changed the title Document improve: use .cargo/config.toml to set env, instead shell Document improve: use .cargo/config.toml to set env Feb 4, 2024
@ldm0
Copy link
Member

ldm0 commented Feb 4, 2024

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

@gezihuzi
Copy link

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

rust-lang/cargo#10273
rust-lang/cargo#10789

@vnghia
Copy link
Contributor

vnghia commented Mar 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants