zstd-seekable 0.1.14

Bindings to the seekable version of ZStandard.
Documentation
fn main() {
    println!("cargo:rerun-if-changed=zstd/contrib/seekable_format/zstdseek_compress.c");
    println!("cargo:rerun-if-changed=zstd/contrib/seekable_format/zstdseek_decompress.c");
    cc::Build::new()
        .file("zstd/contrib/seekable_format/zstdseek_compress.c")
        .file("zstd/contrib/seekable_format/zstdseek_decompress.c")
        .file("xxh64.c")
        .opt_level(3)
        .include("zstd/lib/common")
        .include("zstd/lib")
        .compile("zstdseek");
    if pkg_config::Config::new()
        .range_version("1.4.0".."1.5.0")
        .statik(true)
        .probe("libzstd")
        .is_err()
    {
        let mut cc = cc::Build::new();
        for &dir in &["zstd/lib/common", "zstd/lib/compress", "zstd/lib/decompress"] {
            cc.include(dir);
            for entry in std::fs::read_dir(dir).unwrap() {
                let entry = entry.unwrap();
                let path = entry.path();
                let name = path.file_name();
                if let Some(f) = name {
                    if std::path::Path::new(f).extension().map(|v| v.to_str().unwrap()) == Some("c") {
                        cc.file(path);
                    }
                }
            }
        }
        cc.opt_level(3).compile("zstd");
    }

    if pkg_config::Config::new()
        .statik(true)
        .probe("libxxhash")
        .is_err()
    {
        cc::Build::new()
            .file("xxh64.c")
            .include(".")
            .opt_level(3)
            .compile("xxhash");
    }
}