Skip to content

Commit

Permalink
Remove last instance of is_cross_compiling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Anderson committed Dec 6, 2021
1 parent 288be07 commit f1462fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions src/cross_compile.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ mod build_context;
mod build_options;
mod cargo_toml;
mod compile;
mod cross_compile;
mod develop;
mod metadata;
mod module_writer;
Expand Down
18 changes: 14 additions & 4 deletions src/target.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::cross_compile::is_cross_compiling;
use crate::python_interpreter::InterpreterKind;
use crate::{PlatformTag, PythonInterpreter};
use anyhow::{bail, format_err, Context, Result};
use platform_info::*;
use pyo3_build_config::cross_compiling;
use std::env;
use std::fmt;
use std::path::Path;
Expand Down Expand Up @@ -135,7 +135,7 @@ impl Target {
.map_err(|_| format_err!("Unknown target triple {}", target_triple))?;
(platform, target_triple.to_string())
} else {
let target_triple = host; // get_host_target()?;
let target_triple = host.clone();
let platform: Triple = target_triple
.parse()
.map_err(|_| format_err!("Unknown target triple {}", target_triple))?;
Expand Down Expand Up @@ -185,8 +185,18 @@ impl Target {
triple,
cross_compiling: false,
};
// TODO: replace with pyo3-build-config::cross_compiling
target.cross_compiling = is_cross_compiling(&target)?;

if let Ok(cross_compiling) = cross_compiling(
&host,
&target.target_arch().to_string(),
&target.target_vendor().to_string(),
target.get_python_os(),
) {
target.cross_compiling = cross_compiling.is_some();
} else {
bail!("Failed when detecting cross whether compiling!");
}

Ok(target)
}

Expand Down

0 comments on commit f1462fe

Please sign in to comment.