|
97 | 97 |
|
98 | 98 | #![deny(missing_docs)] |
99 | 99 | #![allow(clippy::needless_doctest_main)] |
| 100 | +#![allow(clippy::uninlined_format_args)] |
100 | 101 |
|
101 | 102 | use std::env; |
102 | 103 | use std::fs::{create_dir_all, write}; |
@@ -200,6 +201,7 @@ impl ImportLibraryGenerator { |
200 | 201 | /// |
201 | 202 | /// The compile target environment ABI name (as in `CARGO_CFG_TARGET_ENV`) |
202 | 203 | /// is passed in `env`. |
| 204 | + #[must_use] |
203 | 205 | pub fn new(arch: &str, env: &str) -> Self { |
204 | 206 | ImportLibraryGenerator { |
205 | 207 | arch: arch.to_string(), |
@@ -293,8 +295,7 @@ impl ImportLibraryGenerator { |
293 | 295 | _ => return Err(Error::new(ErrorKind::Other, "Unsupported Python version")), |
294 | 296 | }, |
295 | 297 | PythonImplementation::PyPy => match self.version { |
296 | | - Some((3, 7)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")), |
297 | | - Some((3, 8)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")), |
| 298 | + Some((3, 7)) | Some((3, 8)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")), |
298 | 299 | Some((3, 9)) => ("libpypy3.9-c.def", include_str!("libpypy3.9-c.def")), |
299 | 300 | Some((3, 10)) => ("libpypy3.10-c.def", include_str!("libpypy3.10-c.def")), |
300 | 301 | _ => return Err(Error::new(ErrorKind::Other, "Unsupported PyPy version")), |
@@ -500,7 +501,7 @@ fn get_mingw_dlltool(arch: &str) -> Result<Command> { |
500 | 501 | } |
501 | 502 | } |
502 | 503 |
|
503 | | -/// Finds the `zig` executable (when built by ``maturin --zig`). |
| 504 | +/// Finds the `zig` executable (when built by `maturin --zig`). |
504 | 505 | /// |
505 | 506 | /// Examines the `ZIG_COMMAND` environment variable |
506 | 507 | /// to find out if `zig cc` is being used as the linker. |
@@ -649,6 +650,33 @@ mod tests { |
649 | 650 | dir.push("aarch64-pc-windows-msvc"); |
650 | 651 | dir.push("python3-dll"); |
651 | 652 |
|
652 | | - generate_implib_for_target(&dir, "aarch64", "msvc").unwrap(); |
| 653 | + ImportLibraryGenerator::new("aarch64", "msvc") |
| 654 | + .generate(&dir) |
| 655 | + .unwrap(); |
| 656 | + |
| 657 | + for minor in 7..=13 { |
| 658 | + ImportLibraryGenerator::new("aarch64", "msvc") |
| 659 | + .version(Some((3, minor))) |
| 660 | + .generate(&dir) |
| 661 | + .unwrap(); |
| 662 | + } |
| 663 | + |
| 664 | + // Free-threaded CPython v3.13+ |
| 665 | + for minor in 13..=13 { |
| 666 | + ImportLibraryGenerator::new("aarch64", "msvc") |
| 667 | + .version(Some((3, minor))) |
| 668 | + .abiflags(Some("t")) |
| 669 | + .generate(&dir) |
| 670 | + .unwrap(); |
| 671 | + } |
| 672 | + |
| 673 | + // PyPy |
| 674 | + for minor in 7..=10 { |
| 675 | + ImportLibraryGenerator::new("aarch64", "msvc") |
| 676 | + .version(Some((3, minor))) |
| 677 | + .implementation(PythonImplementation::PyPy) |
| 678 | + .generate(&dir) |
| 679 | + .unwrap(); |
| 680 | + } |
653 | 681 | } |
654 | 682 | } |
0 commit comments