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:
Ayush Singh 2022-11-08 23:01:15 +05:30
parent 57d3c58ed6
commit 758868cb09
No known key found for this signature in database
GPG Key ID: 05CEF5C789E55A74

View File

@ -44,7 +44,13 @@ pub use t;
/// Given an executable called `name`, return the filename for the
/// executable for a particular target.
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.