annotate libpam-sys/build.rs @ 131:a632a8874131

Get all the Linux-PAM functions into libpam-sys, and get tests right.
author Paul Fisher <paul@pfish.zone>
date Wed, 02 Jul 2025 02:24:21 -0400
parents 80c07e5ab22f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
127
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
1 use libpam_sys_impls::__pam_impl_enum__;
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
2 use strum::{EnumIter, IntoEnumIterator};
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
3
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
4 __pam_impl_enum__!(#[derive(EnumIter)]);
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
5
106
49d9e2b5c189 An irresponsible mix of implementing libpam-sys and other stuff.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
6 fn main() {
49d9e2b5c189 An irresponsible mix of implementing libpam-sys and other stuff.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
7 println!("cargo:rustc-link-lib=pam");
127
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
8 let pam_impl_strs: Vec<_> = PamImpl::iter().map(|e| format!("\"{:?}\"", e)).collect();
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
9 let pam_impls = pam_impl_strs.join(",");
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 108
diff changeset
10 // We use this for ctest. Don't do what we've done; just use cfg_pam_impl.
131
a632a8874131 Get all the Linux-PAM functions into libpam-sys, and get tests right.
Paul Fisher <paul@pfish.zone>
parents: 130
diff changeset
11 println!("cargo:rustc-check-cfg=cfg(_hack_impl, values({pam_impls}))");
a632a8874131 Get all the Linux-PAM functions into libpam-sys, and get tests right.
Paul Fisher <paul@pfish.zone>
parents: 130
diff changeset
12 println!("cargo:rustc-cfg=_hack_impl=\"{:?}\"", PamImpl::CURRENT);
106
49d9e2b5c189 An irresponsible mix of implementing libpam-sys and other stuff.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
13 }