comparison build.rs @ 105:13b4d2a19674

Support Rust v1.75.0. This is the version included in Ubuntu 24.04 LTS and Debian Trixie, so it's old enough to have wide penetration without being too old to get new features (Debian Stable, I love you but v1.63 is just not going to work out).
author Paul Fisher <paul@pfish.zone>
date Thu, 26 Jun 2025 00:48:51 -0400
parents 3f11b8d30f63
children e97534be35e3
comparison
equal deleted inserted replaced
104:a2676475e86b 105:13b4d2a19674
2 use std::env; 2 use std::env;
3 use std::path::PathBuf; 3 use std::path::PathBuf;
4 4
5 fn main() { 5 fn main() {
6 if cfg!(feature = "link") { 6 if cfg!(feature = "link") {
7 println!("cargo::rustc-link-lib=pam"); 7 println!("cargo:rustc-link-lib=pam");
8 println!("cargo::rustc-check-cfg=cfg(pam_impl, values(\"linux-pam\",\"openpam\"))"); 8 println!("cargo:rustc-check-cfg=cfg(pam_impl, values(\"linux-pam\",\"openpam\"))");
9 let common_builder = bindgen::Builder::default() 9 let common_builder = bindgen::Builder::default()
10 .merge_extern_blocks(true) 10 .merge_extern_blocks(true)
11 .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) 11 .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
12 .blocklist_type("pam_handle") 12 .blocklist_type("pam_handle")
13 .blocklist_type("pam_conv") 13 .blocklist_type("pam_conv")
62 ("openpam", bindings) 62 ("openpam", bindings)
63 } else { 63 } else {
64 panic!("unrecognized PAM implementation") 64 panic!("unrecognized PAM implementation")
65 } 65 }
66 }; 66 };
67 println!("cargo::rustc-cfg=pam_impl={pam_impl:?}"); 67 println!("cargo:rustc-cfg=pam_impl={pam_impl:?}");
68 let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 68 let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
69 bindings 69 bindings
70 .write_to_file(out_path.join("bindings.rs")) 70 .write_to_file(out_path.join("bindings.rs"))
71 .unwrap(); 71 .unwrap();
72 } 72 }