view libpam-sys/build.rs @ 129:5b2de52dd8b2

Cleanups: create readmes, add a few docs, remove cruft.
author Paul Fisher <paul@pfish.zone>
date Mon, 30 Jun 2025 23:49:54 -0400
parents ad77f2af5ff4
children 80c07e5ab22f
line wrap: on
line source

use libpam_sys_impls::__pam_impl_enum__;
use strum::{EnumIter, IntoEnumIterator};

__pam_impl_enum__!(#[derive(EnumIter)]);

fn main() {
    println!("cargo:rustc-link-lib=pam");
    let pam_impl_strs: Vec<_> = PamImpl::iter().map(|e| format!("\"{:?}\"", e)).collect();
    let pam_impls = pam_impl_strs.join(",");
    // We use this for ctest. Don't do what we've done; just use cfg_pam_impl.
    println!("cargo:rustc-check-cfg=cfg(_private_pam_impl_hack, values({pam_impls}))");
    println!("cargo:rustc-cfg=_private_pam_impl_hack=\"{:?}\"", PamImpl::CURRENT);
}