Get self-contained directory path via dedicated function
This commit is contained in:
parent
5d298836f2
commit
e9ac01a9be
@ -1075,7 +1075,7 @@ fn get_object_file_path(sess: &Session, name: &str) -> PathBuf {
|
||||
if file_path.exists() {
|
||||
return file_path;
|
||||
}
|
||||
let file_path = fs.get_lib_path().join("self-contained").join(name);
|
||||
let file_path = fs.get_selfcontained_lib_path().join(name);
|
||||
if file_path.exists() {
|
||||
return file_path;
|
||||
}
|
||||
@ -1475,7 +1475,7 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session) {
|
||||
let lib_path = sess.target_filesearch(PathKind::All).get_lib_path();
|
||||
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
|
||||
|
||||
let lib_path = sess.target_filesearch(PathKind::All).get_lib_path().join("self-contained");
|
||||
let lib_path = sess.target_filesearch(PathKind::All).get_selfcontained_lib_path();
|
||||
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,10 @@ impl<'a> FileSearch<'a> {
|
||||
make_target_lib_path(self.sysroot, self.triple)
|
||||
}
|
||||
|
||||
pub fn get_selfcontained_lib_path(&self) -> PathBuf {
|
||||
self.get_lib_path().join("self-contained")
|
||||
}
|
||||
|
||||
pub fn search<F>(&self, mut pick: F)
|
||||
where
|
||||
F: FnMut(&SearchPathFile, PathKind) -> FileMatch,
|
||||
|
Loading…
x
Reference in New Issue
Block a user