Skip to content

Commit

Permalink
pyo3-build-config: switch to python3_dll_a::ImportLibraryGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed May 10, 2022
1 parent f5357f9 commit 9c2ede0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyo3-build-config/Cargo.toml
Expand Up @@ -12,11 +12,11 @@ edition = "2018"

[dependencies]
once_cell = "1"
python3-dll-a = { version = "0.2", optional = true }
python3-dll-a = { version = "0.2.2", optional = true }
target-lexicon = "0.12"

[build-dependencies]
python3-dll-a = { version = "0.2", optional = true }
python3-dll-a = { version = "0.2.2", optional = true }
target-lexicon = "0.12"

[features]
Expand Down
8 changes: 4 additions & 4 deletions pyo3-build-config/src/impl_.rs
Expand Up @@ -3,8 +3,8 @@

// Optional python3.dll import library generator for Windows
#[cfg(feature = "python3-dll-a")]
#[path = "abi3_import_lib.rs"]
mod abi3_import_lib;
#[path = "import_lib.rs"]
mod import_lib;

use std::{
collections::{HashMap, HashSet},
Expand Down Expand Up @@ -1410,7 +1410,7 @@ fn default_cross_compile(cross_compile_config: &CrossCompileConfig) -> Result<In
// Auto generate python3.dll import libraries for Windows targets.
#[cfg(feature = "python3-dll-a")]
if abi3 && lib_dir.is_none() {
lib_dir = self::abi3_import_lib::generate_abi3_import_lib(&cross_compile_config.target)?;
lib_dir = self::import_lib::generate_abi3_import_lib(&cross_compile_config.target)?;
}

Ok(InterpreterConfig {
Expand Down Expand Up @@ -1723,7 +1723,7 @@ pub fn make_interpreter_config() -> Result<InterpreterConfig> {
// Auto generate python3.dll import libraries for Windows targets.
#[cfg(feature = "python3-dll-a")]
{
interpreter_config.lib_dir = self::abi3_import_lib::generate_abi3_import_lib(&host)?;
interpreter_config.lib_dir = self::import_lib::generate_abi3_import_lib(&host)?;
}

Ok(interpreter_config)
Expand Down
Expand Up @@ -3,7 +3,7 @@
use std::env;
use std::path::PathBuf;

use python3_dll_a::generate_implib_for_target;
use python3_dll_a::ImportLibraryGenerator;

use crate::errors::{Context, Result};

Expand Down Expand Up @@ -36,7 +36,8 @@ pub(super) fn generate_abi3_import_lib(target: &Triple) -> Result<Option<String>

let env = target.environment.to_string();

generate_implib_for_target(&out_lib_dir, &arch, &env)
ImportLibraryGenerator::new(&arch, &env)
.generate(&out_lib_dir)
.context("failed to generate python3.dll import library")?;

let out_lib_dir_string = out_lib_dir
Expand Down

0 comments on commit 9c2ede0

Please sign in to comment.