From d6040617c230217a8af47b5c1a64c683a494a045 Mon Sep 17 00:00:00 2001 From: Paul-Erwan RIO Date: Sun, 28 Jul 2024 16:05:41 +0200 Subject: [PATCH] fix: use PYO3_CROSS_LIB_DIR value as lib_dir when cross-compiling (#4350) --- pyo3-build-config/src/impl_.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs index d38d41ed552..2d815d78011 100644 --- a/pyo3-build-config/src/impl_.rs +++ b/pyo3-build-config/src/impl_.rs @@ -1404,7 +1404,10 @@ fn cross_compile_from_sysconfigdata( ) -> Result> { if let Some(path) = find_sysconfigdata(cross_compile_config)? { let data = parse_sysconfigdata(path)?; - let config = InterpreterConfig::from_sysconfigdata(&data)?; + let mut config = InterpreterConfig::from_sysconfigdata(&data)?; + if let Some(cross_lib_dir) = cross_compile_config.lib_dir_string() { + config.lib_dir = Some(cross_lib_dir) + } Ok(Some(config)) } else {