@@ -16,6 +16,7 @@ pub use package_id::PkgId;
1616pub use target:: { OutputType , Main , Lib , Test , Bench , Target , Build , Install } ;
1717pub use version:: { Version , NoVersion , split_version_general, try_parsing_version} ;
1818pub use rustc:: metadata:: filesearch:: rust_path;
19+ use rustc:: metadata:: filesearch:: libdir;
1920use rustc:: driver:: driver:: host_triple;
2021
2122use std:: libc;
@@ -113,7 +114,7 @@ pub fn target_build_dir(workspace: &Path) -> Path {
113114/// Return the target-specific lib subdirectory, pushed onto `base`;
114115/// doesn't check that it exists or create it
115116fn target_lib_dir ( workspace : & Path ) -> Path {
116- let mut dir = workspace. join ( "lib" ) ;
117+ let mut dir = workspace. join ( libdir ( ) ) ;
117118 dir. push ( host_triple ( ) ) ;
118119 dir
119120}
@@ -184,7 +185,7 @@ pub fn installed_library_in_workspace(pkg_path: &Path, workspace: &Path) -> Opti
184185 short_name,
185186 Install ,
186187 workspace,
187- "lib" ,
188+ libdir ( ) ,
188189 & NoVersion )
189190 }
190191}
@@ -212,7 +213,7 @@ pub fn library_in_workspace(path: &Path, short_name: &str, where: Target,
212213
213214// rustc doesn't use target-specific subdirectories
214215pub fn system_library ( sysroot : & Path , lib_name : & str ) -> Option < Path > {
215- library_in ( lib_name, & NoVersion , & sysroot. join ( "lib" ) )
216+ library_in ( lib_name, & NoVersion , & sysroot. join ( libdir ( ) ) )
216217}
217218
218219fn library_in ( short_name : & str , version : & Version , dir_to_search : & Path ) -> Option < Path > {
0 commit comments