Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/contrib/libgit-sys/build.rs # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / contrib / libgit-sys / build.rs` 35 lines ยท 1171 bytes Raw Blame History 1 use std::env; 2 use std::path::PathBuf; 3 4 pub fn main() -> std::io::Result<()> { 5 let ac = autocfg::new(); 6 ac.emit_has_path("std::ffi::c_char"); 7 8 let crate_root = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); 9 let git_root = crate_root.join("../.."); 10 let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap()); 11 12 let make_output = make_cmd::gnu_make() 13 .env("DEVELOPER", "1") 14 .env_remove("PROFILE") 15 .current_dir(git_root.clone()) 16 .args([ 17 "INCLUDE_LIBGIT_RS=YesPlease", 18 "contrib/libgit-sys/libgitpub.a", 19 ]) 20 .output() 21 .expect("Make failed to run"); 22 if !make_output.status.success() { 23 panic!( 24 "Make failed:\n stdout = {}\n stderr = {}\n", 25 String::from_utf8(make_output.stdout).unwrap(), 26 String::from_utf8(make_output.stderr).unwrap() 27 ); 28 } 29 std::fs::copy(crate_root.join("libgitpub.a"), dst.join("libgitpub.a"))?; 30 println!("cargo:rustc-link-search=native={}", dst.display()); 31 println!("cargo:rustc-link-lib=gitpub"); 32 println!("cargo:rerun-if-changed={}", git_root.display()); 33 34 Ok(()) 35 }