@@ -22,7 +22,7 @@ use std::{
22
22
23
23
pub use target_lexicon:: Triple ;
24
24
25
- use target_lexicon:: { Environment , OperatingSystem } ;
25
+ use target_lexicon:: { Architecture , Environment , OperatingSystem } ;
26
26
27
27
use crate :: {
28
28
bail, ensure,
@@ -944,7 +944,9 @@ impl CrossCompileConfig {
944
944
945
945
// Not cross-compiling to compile for 32-bit Python from windows 64-bit
946
946
compatible |= target. operating_system == OperatingSystem :: Windows
947
- && host. operating_system == OperatingSystem :: Windows ;
947
+ && host. operating_system == OperatingSystem :: Windows
948
+ && matches ! ( target. architecture, Architecture :: X86_32 ( _) )
949
+ && host. architecture == Architecture :: X86_64 ;
948
950
949
951
// Not cross-compiling to compile for x86-64 Python from macOS arm64 and vice versa
950
952
compatible |= target. operating_system == OperatingSystem :: Darwin
@@ -2955,6 +2957,16 @@ mod tests {
2955
2957
. is_none( ) ) ;
2956
2958
}
2957
2959
2960
+ #[ test]
2961
+ fn test_is_cross_compiling_from_to ( ) {
2962
+ assert ! ( cross_compiling_from_to(
2963
+ & triple!( "x86_64-pc-windows-msvc" ) ,
2964
+ & triple!( "aarch64-pc-windows-msvc" )
2965
+ )
2966
+ . unwrap( )
2967
+ . is_some( ) ) ;
2968
+ }
2969
+
2958
2970
#[ test]
2959
2971
fn test_run_python_script ( ) {
2960
2972
// as above, this should be okay in CI where Python is presumed installed
0 commit comments