leveldb-rs-binding 2.2.0

An interface for the LevelDB
Documentation
//! Boost library build module.
//
// Boost::unordered is header-only. This module locates the boost header
// include directories after `configure-extension-lib-boost` has fetched
// the required library submodules into `deps/boost/libs/*/include/`.

use std::path::PathBuf;

pub struct BoostBuild {
    pub include_dirs: Vec<PathBuf>,
}

#[cfg(feature = "experimental-extension")]
pub fn build() -> BoostBuild {
    use std::path::Path;
    println!("[boost] Locating header-only include directories");

    let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
    let boost_libs = Path::new(&manifest_dir)
        .join("deps")
        .join("boost")
        .join("libs");
    let mut include_dirs = Vec::new();

    if boost_libs.exists()
        && let Ok(entries) = std::fs::read_dir(&boost_libs)
    {
        for entry in entries.flatten() {
            let include_dir = entry.path().join("include");
            if include_dir.is_dir() {
                include_dirs.push(include_dir);
            }
        }
    }

    println!("[boost] Found {} include directories", include_dirs.len());

    BoostBuild { include_dirs }
}