Skip to content

Commit

Permalink
Auto generate Windows import libraries when using a pyo3 config file
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed May 14, 2022
1 parent 87bd10c commit 6b84de3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,24 @@ print("mingw", get_platform().startswith("mingw"))
let implementation = implementation.unwrap_or(PythonImplementation::CPython);
let abi3 = abi3.unwrap_or(false);

// Auto generate python3.dll import libraries for Windows targets.
#[cfg(feature = "python3-dll-a")]
{
let target = target_triple_from_env();
if lib_name.is_none() && target.operating_system == OperatingSystem::Windows {
lib_name = Some(default_lib_name_windows(
version,
implementation,
abi3,
false,
));
}
if lib_dir.is_none() {
let py_version = if abi3 { None } else { Some(version) };
lib_dir = self::import_lib::generate_import_lib(&target, py_version)?;
}
}

Ok(InterpreterConfig {
implementation,
version,
Expand Down

0 comments on commit 6b84de3

Please sign in to comment.