diff options
| author | Mateusz Mikuła <mati865@gmail.com> | 2020-06-08 12:47:56 +0200 |
|---|---|---|
| committer | Mateusz Mikuła <mati865@gmail.com> | 2020-06-11 18:48:43 +0200 |
| commit | e9ac01a9beeae77a15badcec094a7a4da0bebecb (patch) | |
| tree | 52ae7fa26e768c6ceb16eeb7b97ebe5be49d5d5c | |
| parent | 5d298836f2254144f80e56ee37af44ac79f3eb2c (diff) | |
| download | rust-e9ac01a9beeae77a15badcec094a7a4da0bebecb.tar.gz rust-e9ac01a9beeae77a15badcec094a7a4da0bebecb.zip | |
Get self-contained directory path via dedicated function
| -rw-r--r-- | src/librustc_codegen_ssa/back/link.rs | 4 | ||||
| -rw-r--r-- | src/librustc_session/filesearch.rs | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs index c57b01dff28..1eef86f6c93 100644 --- a/src/librustc_codegen_ssa/back/link.rs +++ b/src/librustc_codegen_ssa/back/link.rs @@ -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)); } diff --git a/src/librustc_session/filesearch.rs b/src/librustc_session/filesearch.rs index e98746231fb..37d7b0c7e1f 100644 --- a/src/librustc_session/filesearch.rs +++ b/src/librustc_session/filesearch.rs @@ -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, |
