Skip to content

Commit

Permalink
Detect and use IPHONEOS_DEPLOYMENT_TARGET for the `-mi*os-version-m…
Browse files Browse the repository at this point in the history
…in` flag

If it isn't set, fallback to the previous setting of `-miphoneos-version-min=7.0` for real devices and `mios-simulator-version-min=7.0` for simulators.
  • Loading branch information
turboladen committed Aug 8, 2019
1 parent f6f6c81 commit bae28ef
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 @@ -1627,16 +1627,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 bae28ef

Please sign in to comment.