Skip to content

Commit

Permalink
Merge pull request #433 from turboladen/feature/config-ios-version-min
Browse files Browse the repository at this point in the history
Detect and use `IPHONEOS_DEPLOYMENT_TARGET` for the `-mi*os-version-min` flag
  • Loading branch information
alexcrichton authored Aug 12, 2019
2 parents f99a424 + bae28ef commit 5c0dc67
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,16 +1632,19 @@ impl Build {
}
};

let min_version = std::env::var("IPHONEOS_DEPLOYMENT_TARGET")
.unwrap_or_else(|_| "7.0".into());

let sdk = match arch {
ArchSpec::Device(arch) => {
cmd.args.push("-arch".into());
cmd.args.push(arch.into());
cmd.args.push("-miphoneos-version-min=7.0".into());
cmd.args.push(format!("-miphoneos-version-min={}", min_version).into());
"iphoneos"
}
ArchSpec::Simulator(arch) => {
cmd.args.push(arch.into());
cmd.args.push("-mios-simulator-version-min=7.0".into());
cmd.args.push(format!("-mios-simulator-version-min={}", min_version).into());
"iphonesimulator"
}
};
Expand Down

0 comments on commit 5c0dc67

Please sign in to comment.