rustc_session: Add a helper function for obtaining staticlib prefix and suffix
This commit is contained in:
parent
27e95f95e6
commit
7c55782e0c
5 changed files with 24 additions and 24 deletions
|
@ -103,7 +103,7 @@ pub fn filename_for_input(
|
|||
OutFileName::Real(outputs.out_directory.join(&format!("{prefix}{libname}{suffix}")))
|
||||
}
|
||||
CrateType::Staticlib => {
|
||||
let (prefix, suffix) = (&sess.target.staticlib_prefix, &sess.target.staticlib_suffix);
|
||||
let (prefix, suffix) = sess.staticlib_components(false);
|
||||
OutFileName::Real(outputs.out_directory.join(&format!("{prefix}{libname}{suffix}")))
|
||||
}
|
||||
CrateType::Executable => {
|
||||
|
|
|
@ -586,6 +586,14 @@ impl Session {
|
|||
.or(self.target.options.default_visibility)
|
||||
.unwrap_or(SymbolVisibility::Interposable)
|
||||
}
|
||||
|
||||
pub fn staticlib_components(&self, verbatim: bool) -> (&str, &str) {
|
||||
if verbatim {
|
||||
("", "")
|
||||
} else {
|
||||
(&*self.target.staticlib_prefix, &*self.target.staticlib_suffix)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// JUSTIFICATION: defn of the suggested wrapper fns
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue