fn main() {
    println!("cargo:rerun-if-changed=cpp/ptex_filter_wrapper.cpp");

    let home = std::env::var("HOME").unwrap();
    let ptex_include = format!("{}/.local/include", home);
    let ptex_lib = format!("{}/.local/lib", home);

    cc::Build::new()
        .cpp(true)
        .file("cpp/ptex_filter_wrapper.cpp")
        .include(&ptex_include)
        .flag("-std=c++17")
        .compile("ptex_filter_wrapper");

    println!("cargo:rustc-link-search=native={}", ptex_lib);
    println!("cargo:rustc-link-lib=Ptex");
}
