Skip to content

Commit bae28ef

Browse files
committedAug 8, 2019
Detect and use IPHONEOS_DEPLOYMENT_TARGET for the -mi*os-version-min 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.
1 parent f6f6c81 commit bae28ef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1627,16 +1627,19 @@ impl Build {
16271627
}
16281628
};
16291629

1630+
let min_version = std::env::var("IPHONEOS_DEPLOYMENT_TARGET")
1631+
.unwrap_or_else(|_| "7.0".into());
1632+
16301633
let sdk = match arch {
16311634
ArchSpec::Device(arch) => {
16321635
cmd.args.push("-arch".into());
16331636
cmd.args.push(arch.into());
1634-
cmd.args.push("-miphoneos-version-min=7.0".into());
1637+
cmd.args.push(format!("-miphoneos-version-min={}", min_version).into());
16351638
"iphoneos"
16361639
}
16371640
ArchSpec::Simulator(arch) => {
16381641
cmd.args.push(arch.into());
1639-
cmd.args.push("-mios-simulator-version-min=7.0".into());
1642+
cmd.args.push(format!("-mios-simulator-version-min={}", min_version).into());
16401643
"iphonesimulator"
16411644
}
16421645
};

0 commit comments

Comments
 (0)