Skip to content

Commit

Permalink
Don't import vcpkg on Windows by default (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm0 authored Aug 25, 2024
1 parent ae45d1f commit 5cd535e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ vcpkg = { version = "0.2", optional = true }
[target.'cfg(not(windows))'.build-dependencies]
pkg-config = "0.3"

[target.'cfg(windows)'.build-dependencies]
vcpkg = "0.2"

[features]
# linking system ffmpeg as fallback.
# Probe and link FFmpeg with pkg-config
link_system_ffmpeg = []
# link against vcpkg ffmpeg
# Probe and link FFmpeg with vcpkg
link_vcpkg_ffmpeg = ["vcpkg"]
# FFmpeg 5.* support
ffmpeg5 = []
Expand Down
9 changes: 4 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ fn static_linking(env_vars: &EnvVars) {
output_binding_path: &Path,
) -> Result<(), pkg_config::Error> {
// Probe libraries(enable emitting cargo metadata)
let include_paths = linking_with_pkg_config(&*LIBS)?;
let include_paths = pkg_config_linking::linking_with_pkg_config(&*LIBS)?;
if let Some(ffmpeg_binding_path) = env_vars.ffmpeg_binding_path.as_ref() {
use_prebuilt_binding(ffmpeg_binding_path, output_binding_path);
} else if let Some(ffmpeg_include_dir) = env_vars.ffmpeg_include_dir.as_ref() {
Expand All @@ -419,7 +419,6 @@ fn static_linking(env_vars: &EnvVars) {
}
Ok(())
}
use pkg_config_linking::*;
// Hint: set PKG_CONFIG_PATH to some placeholder value will let pkg_config probing system library.
if let Some(ffmpeg_pkg_config_path) = env_vars.ffmpeg_pkg_config_path.as_ref() {
if !Path::new(ffmpeg_pkg_config_path).exists() {
Expand Down Expand Up @@ -447,9 +446,9 @@ fn static_linking(env_vars: &EnvVars) {
panic!(
"
!!!!!!! rusty_ffmpeg: No linking method set!
Use FFMPEG_PKG_CONFIG_PATH or FFMPEG_LIBS_DIR if you have prebuilt FFmpeg libraries.
Enable `link_system_ffmpeg` feature if you want to link ffmpeg libraries install in system path.
Enable `link_vcpkg_ffmpeg` feature if you want to link ffmpeg provided by vcpkg.
Use `FFMPEG_PKG_CONFIG_PATH` or `FFMPEG_LIBS_DIR` if you have prebuilt FFmpeg libraries.
Enable `link_system_ffmpeg` feature if you want to link ffmpeg libraries installed in system path(which can be probed by pkg-config).
Enable `link_vcpkg_ffmpeg` feature if you want to link ffmpeg libraries installed by vcpkg.
"
);
#[cfg(any(feature = "link_system_ffmpeg", feature = "link_vcpkg_ffmpeg"))]
Expand Down

0 comments on commit 5cd535e

Please sign in to comment.