Skip to content

Commit

Permalink
Guessed platform may be incorrect, so do not force compilation with it
Browse files Browse the repository at this point in the history
  • Loading branch information
al626 authored and messense committed Apr 5, 2021
1 parent 1239c4f commit 0ea33a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ __pycache__/
dist/
build
dist
tags
19 changes: 8 additions & 11 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ pub fn compile(
if context.target.is_macos() && context.universal2 {
compile_universal2(context, python_interpreter, bindings_crate)
} else {
compile_target(
context,
python_interpreter,
bindings_crate,
context.target.target_triple(),
)
compile_target(context, python_interpreter, bindings_crate, None)
}
}

Expand All @@ -45,7 +40,7 @@ fn compile_universal2(
context,
python_interpreter,
bindings_crate,
"aarch64-apple-darwin",
Some("aarch64-apple-darwin"),
)
.context("Failed to build a aarch64 library through cargo")?
.get(build_type)
Expand All @@ -64,7 +59,7 @@ fn compile_universal2(
context,
python_interpreter,
bindings_crate,
"x86_64-apple-darwin",
Some("x86_64-apple-darwin"),
)
.context("Failed to build a x86_64 library through cargo")?
.get(build_type)
Expand Down Expand Up @@ -107,7 +102,7 @@ fn compile_target(
context: &BuildContext,
python_interpreter: Option<&PythonInterpreter>,
bindings_crate: &BridgeModel,
target: &str,
target: Option<&str>,
) -> Result<HashMap<String, PathBuf>> {
let mut shared_args = vec!["--manifest-path", context.manifest_path.to_str().unwrap()];

Expand All @@ -116,8 +111,10 @@ fn compile_target(
if context.release {
shared_args.push("--release");
}
shared_args.push("--target");
shared_args.push(target);
if let Some(target) = target {
shared_args.push("--target");
shared_args.push(target);
}

let mut rustc_args: Vec<&str> = context
.rustc_extra_args
Expand Down

0 comments on commit 0ea33a2

Please sign in to comment.