Skip to content

Commit

Permalink
fix: use PYO3_CROSS_LIB_DIR value as lib_dir when cross-compiling (#4350
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Paul-Erwan RIO committed Jul 28, 2024
1 parent dae091f commit 49dbfab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1405,8 +1405,15 @@ fn cross_compile_from_sysconfigdata(
) -> Result<Option<InterpreterConfig>> {
if let Some(path) = find_sysconfigdata(cross_compile_config)? {
let data = parse_sysconfigdata(path)?;
let config = InterpreterConfig::from_sysconfigdata(&data)?;
// RFC: ignore lib_dir from sysconfig and use one from CrossCompileConfig input ?
let config = if cross_compile_config.lib_dir.is_some() {
InterpreterConfig {
lib_dir: cross_compile_config.lib_dir.as_ref().map(|path| path.display().to_string()),
..InterpreterConfig::from_sysconfigdata(&data)?
}
} else {
InterpreterConfig::from_sysconfigdata(&data)?
};

Ok(Some(config))
} else {
Expand Down

0 comments on commit 49dbfab

Please sign in to comment.