refactor: Move env parsing of deployment target to rustc_session
This commit is contained in:
parent
d74ce25b65
commit
7e4379c4eb
11 changed files with 74 additions and 75 deletions
|
@ -317,3 +317,15 @@ impl OSVersion {
|
|||
Self { major, minor, patch }
|
||||
}
|
||||
}
|
||||
|
||||
/// Name of the environment variable used to fetch the deployment target on the given OS.
|
||||
pub fn deployment_target_env_var(os: &str) -> &'static str {
|
||||
match os {
|
||||
"macos" => "MACOSX_DEPLOYMENT_TARGET",
|
||||
"ios" => "IPHONEOS_DEPLOYMENT_TARGET",
|
||||
"watchos" => "WATCHOS_DEPLOYMENT_TARGET",
|
||||
"tvos" => "TVOS_DEPLOYMENT_TARGET",
|
||||
"visionos" => "XROS_DEPLOYMENT_TARGET",
|
||||
_ => unreachable!("tried to get deployment target env var for non-Apple platform"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue