diff libpam-sys/libpam-sys-test/build.rs @ 190:995aca290452

Restructure the way libpam-sys-impls works to fix cross-compilation. The previous structure of libpam-sys-impls meant that things got confusing (including for me) between what constants were build-time and what constants were run-time. This broke cross-compilation. This simplifies the way that works so that `libpam-sys-impls` has *no* build script itself and is intended mostly as a library to be included in other libraries' build scripts (while also exporting the PamImpl enum).
author Paul Fisher <paul@pfish.zone>
date Sat, 02 Aug 2025 18:47:46 -0400
parents 0730f5f2ee2a
children
line wrap: on
line diff
--- a/libpam-sys/libpam-sys-test/build.rs	Thu Jul 31 15:42:12 2025 -0400
+++ b/libpam-sys/libpam-sys-test/build.rs	Sat Aug 02 18:47:46 2025 -0400
@@ -1,5 +1,5 @@
 use bindgen::MacroTypeVariation;
-use libpam_sys_impls::pam_impl_name;
+use libpam_sys::pam_impl_name;
 use libpam_sys_impls::PamImpl;
 use proc_macro2::{Group, Ident, TokenStream, TokenTree};
 use quote::{format_ident, ToTokens};
@@ -13,7 +13,7 @@
 
 fn main() {
     libpam_sys_impls::enable_pam_impl_cfg();
-    let config = match PamImpl::CURRENT {
+    let config = match libpam_sys::pam_impl::CURRENT {
         PamImpl::LinuxPam => TestConfig {
             headers: vec![
                 "<security/_pam_types.h>",
@@ -76,8 +76,8 @@
         "#[allow(deprecated, overflowing_literals)]".into(),
         "fn main() {".into(),
         format!(
-            "assert_eq!(libpam_sys::pam_impl::PamImpl::CURRENT, libpam_sys::pam_impl::PamImpl::{:?});",
-            PamImpl::CURRENT
+            "assert_eq!(libpam_sys::pam_impl::CURRENT, libpam_sys::pam_impl::PamImpl::{:?});",
+            libpam_sys::pam_impl::CURRENT
         ),
     ];
     tests.extend(