about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-14 06:56:28 -0800
committerbors <bors@rust-lang.org>2013-12-14 06:56:28 -0800
commit7eb50c203b7623ecfa45668f38991249ce7be3d0 (patch)
treeb0b4c1000ffd4260bec47f17a45f820a670e3fb7
parentb2750bca0c9a6b6e995624a56bb5236a91a20901 (diff)
parent85d33a093aadfc47a859724f192563195d454e7b (diff)
downloadrust-7eb50c203b7623ecfa45668f38991249ce7be3d0.tar.gz
rust-7eb50c203b7623ecfa45668f38991249ce7be3d0.zip
auto merge of #10938 : jhasse/rust/patch-rustpkg, r=alexcrichton
rustpkg assumes library files to be in a directory called `lib`, but on Windows they are instead in the `bin` directory. This patch changes nothing on Unix system, since `libdir()` returns `"lib"` there.
-rw-r--r--src/librustpkg/path_util.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs
index 7a17d362625..a6b1088335c 100644
--- a/src/librustpkg/path_util.rs
+++ b/src/librustpkg/path_util.rs
@@ -16,6 +16,7 @@ pub use package_id::PkgId;
 pub use target::{OutputType, Main, Lib, Test, Bench, Target, Build, Install};
 pub use version::{Version, NoVersion, split_version_general, try_parsing_version};
 pub use rustc::metadata::filesearch::rust_path;
+use rustc::metadata::filesearch::libdir;
 use rustc::driver::driver::host_triple;
 
 use std::libc;
@@ -113,7 +114,7 @@ pub fn target_build_dir(workspace: &Path) -> Path {
 /// Return the target-specific lib subdirectory, pushed onto `base`;
 /// doesn't check that it exists or create it
 fn target_lib_dir(workspace: &Path) -> Path {
-    let mut dir = workspace.join("lib");
+    let mut dir = workspace.join(libdir());
     dir.push(host_triple());
     dir
 }
@@ -184,7 +185,7 @@ pub fn installed_library_in_workspace(pkg_path: &Path, workspace: &Path) -> Opti
                                                  short_name,
                                                  Install,
                                                  workspace,
-                                                 "lib",
+                                                 libdir(),
                                                  &NoVersion)
     }
 }
@@ -212,7 +213,7 @@ pub fn library_in_workspace(path: &Path, short_name: &str, where: Target,
 
 // rustc doesn't use target-specific subdirectories
 pub fn system_library(sysroot: &Path, lib_name: &str) -> Option<Path> {
-    library_in(lib_name, &NoVersion, &sysroot.join("lib"))
+    library_in(lib_name, &NoVersion, &sysroot.join(libdir()))
 }
 
 fn library_in(short_name: &str, version: &Version, dir_to_search: &Path) -> Option<Path> {