Skip to content

Commit 5cd535e

Browse files
authored
Don't import vcpkg on Windows by default (#124)
1 parent ae45d1f commit 5cd535e

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@ vcpkg = { version = "0.2", optional = true }
3333
[target.'cfg(not(windows))'.build-dependencies]
3434
pkg-config = "0.3"
3535

36-
[target.'cfg(windows)'.build-dependencies]
37-
vcpkg = "0.2"
38-
3936
[features]
40-
# linking system ffmpeg as fallback.
37+
# Probe and link FFmpeg with pkg-config
4138
link_system_ffmpeg = []
42-
# link against vcpkg ffmpeg
39+
# Probe and link FFmpeg with vcpkg
4340
link_vcpkg_ffmpeg = ["vcpkg"]
4441
# FFmpeg 5.* support
4542
ffmpeg5 = []

build.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ fn static_linking(env_vars: &EnvVars) {
404404
output_binding_path: &Path,
405405
) -> Result<(), pkg_config::Error> {
406406
// Probe libraries(enable emitting cargo metadata)
407-
let include_paths = linking_with_pkg_config(&*LIBS)?;
407+
let include_paths = pkg_config_linking::linking_with_pkg_config(&*LIBS)?;
408408
if let Some(ffmpeg_binding_path) = env_vars.ffmpeg_binding_path.as_ref() {
409409
use_prebuilt_binding(ffmpeg_binding_path, output_binding_path);
410410
} else if let Some(ffmpeg_include_dir) = env_vars.ffmpeg_include_dir.as_ref() {
@@ -419,7 +419,6 @@ fn static_linking(env_vars: &EnvVars) {
419419
}
420420
Ok(())
421421
}
422-
use pkg_config_linking::*;
423422
// Hint: set PKG_CONFIG_PATH to some placeholder value will let pkg_config probing system library.
424423
if let Some(ffmpeg_pkg_config_path) = env_vars.ffmpeg_pkg_config_path.as_ref() {
425424
if !Path::new(ffmpeg_pkg_config_path).exists() {
@@ -447,9 +446,9 @@ fn static_linking(env_vars: &EnvVars) {
447446
panic!(
448447
"
449448
!!!!!!! rusty_ffmpeg: No linking method set!
450-
Use FFMPEG_PKG_CONFIG_PATH or FFMPEG_LIBS_DIR if you have prebuilt FFmpeg libraries.
451-
Enable `link_system_ffmpeg` feature if you want to link ffmpeg libraries install in system path.
452-
Enable `link_vcpkg_ffmpeg` feature if you want to link ffmpeg provided by vcpkg.
449+
Use `FFMPEG_PKG_CONFIG_PATH` or `FFMPEG_LIBS_DIR` if you have prebuilt FFmpeg libraries.
450+
Enable `link_system_ffmpeg` feature if you want to link ffmpeg libraries installed in system path(which can be probed by pkg-config).
451+
Enable `link_vcpkg_ffmpeg` feature if you want to link ffmpeg libraries installed by vcpkg.
453452
"
454453
);
455454
#[cfg(any(feature = "link_system_ffmpeg", feature = "link_vcpkg_ffmpeg"))]

0 commit comments

Comments
 (0)