Rollup merge of #104158 - Ayush1325:executable, r=Mark-Simulacrum

Return .efi extension for EFI executable

Originally part of https://github.com/rust-lang/rust/pull/100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
This commit is contained in:
Manish Goregaokar 2022-11-13 21:49:25 -05:00 committed by GitHub
commit 7c67cb2300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,13 @@ pub use t;
/// Given an executable called `name`, return the filename for the /// Given an executable called `name`, return the filename for the
/// executable for a particular target. /// executable for a particular target.
pub fn exe(name: &str, target: TargetSelection) -> String { pub fn exe(name: &str, target: TargetSelection) -> String {
if target.contains("windows") { format!("{}.exe", name) } else { name.to_string() } if target.contains("windows") {
format!("{}.exe", name)
} else if target.contains("uefi") {
format!("{}.efi", name)
} else {
name.to_string()
}
} }
/// Returns `true` if the file name given looks like a dynamic library. /// Returns `true` if the file name given looks like a dynamic library.