Skip to content

Mac Catalyst: Read IPHONEOS_DEPLOYMENT_TARGET from environment variable to support Clang 13 #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1573,8 +1573,12 @@ impl Build {
if let Some(arch) =
map_darwin_target_from_rust_to_compiler_architecture(target)
{
cmd.args
.push(format!("--target={}-apple-ios13.0-macabi", arch).into());
let deployment_target = env::var("IPHONEOS_DEPLOYMENT_TARGET")
Copy link
Author

@imWildCat imWildCat May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether it is a good way. But as an iOS developer, I believe it makes sense. Because in Xcode, Mac Catalyst minimal version is highly related to minimal iOS version. For example, if I choose iOS 14.0, I can only pick macOS 11+ for this situation:

image

image

.unwrap_or_else(|_| "13.0".into());
cmd.args.push(
format!("--target={}-apple-ios{}-macabi", arch, deployment_target)
.into(),
);
}
} else if target.contains("ios-sim") {
if let Some(arch) =
Expand Down