zmwangx / rust-ffmpeg-sys

FFmpeg bindings for Rust.
125 stars 86 forks source link

Provide an output of the statically linked location for other build scripts #86

Open dmtrKovalenko opened 1 month ago

dmtrKovalenko commented 1 month ago

If I have my own crate that has a C file with some ffmpeg helpers (e.g. I want to use a macros that is not covered by rust-ffmpeg-sys) I need a completely new separate installation and build of ffmepg to be able to link against it. even if I use "build" feature and ffmpeg-sys already cloned and built ffmpeg for my target platform

It would be amazing if in my crate's build script I'll be able to get the ffmpeg's location by simply looking into specified directory like

    let ffmpeg_include_path = env::var("RUST_FFMPEG_SYS_DIRECTORY").unwrap();
    cc::Build::new()
        .file("ffmpeg_helper.c")
        .header(Path::from(ffmpeg_include_path).join("libavcodec/avcodec.h"))
        .compile("ffmpeg_helper");