refactor: Move env parsing of deployment target to rustc_session

This commit is contained in:
Mads Marquart
2025-02-11 11:02:36 +01:00
parent d74ce25b65
commit 7e4379c4eb
11 changed files with 74 additions and 75 deletions

View File

@@ -3115,7 +3115,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
_ => bug!("invalid OS/ABI combination for Apple target: {target_os}, {target_abi}"),
};
let min_version = apple::deployment_target(sess).fmt_full().to_string();
let min_version = sess.apple_deployment_target().fmt_full().to_string();
// The SDK version is used at runtime when compiling with a newer SDK / version of Xcode:
// - By dyld to give extra warnings and errors, see e.g.:
@@ -3184,7 +3184,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
// The presence of `-mmacosx-version-min` makes CC default to
// macOS, and it sets the deployment target.
let version = apple::deployment_target(sess).fmt_full();
let version = sess.apple_deployment_target().fmt_full();
// Intentionally pass this as a single argument, Clang doesn't
// seem to like it otherwise.
cmd.cc_arg(&format!("-mmacosx-version-min={version}"));