refactor: Move env parsing of deployment target to rustc_session
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user