build: Build libraries in the bin directory on win32

This commit is contained in:
Brian Anderson 2012-01-10 17:45:03 -08:00
parent 84664304cc
commit 9e40e43e74
6 changed files with 52 additions and 17 deletions

View file

@ -191,7 +191,6 @@ fn minimize_rpaths(rpaths: [str]) -> [str] {
#[cfg(target_os = "linux")]
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
#[cfg(test)]
mod test {
#[test]
fn test_rpaths_to_flags() {

View file

@ -16,6 +16,7 @@ export pick_file;
export search;
export relative_target_lib_path;
export get_cargo_root;
export libdir;
type pick<T> = block(path: fs::path) -> option::t<T>;
@ -81,7 +82,7 @@ fn search<T: copy>(filesearch: filesearch, pick: pick<T>) -> option::t<T> {
}
fn relative_target_lib_path(target_triple: str) -> [fs::path] {
["lib", "rustc", target_triple, "lib"]
[libdir(), "rustc", target_triple, libdir()]
}
fn make_target_lib_path(sysroot: fs::path,
@ -122,6 +123,16 @@ fn get_cargo_root() -> result::t<fs::path, str> {
fn get_cargo_lib_path() -> result::t<fs::path, str> {
result::chain(get_cargo_root()) { |p|
result::ok(fs::connect(p, "lib"))
result::ok(fs::connect(p, libdir()))
}
}
}
// The name of the directory rustc expects libraries to be located.
// On Unix should be "lib", on windows "bin"
fn libdir() -> str {
let libdir = #env("CFG_LIBDIR");
if str::is_empty(libdir) {
fail "rustc compiled without CFG_LIBDIR environment variable";
}
libdir
}

View file

@ -29,11 +29,11 @@ snapshot_files = {
"lib/librustrt.dylib",
"lib/librustllvm.dylib"],
"winnt": ["bin/rustc.exe",
"lib/core-*.dll",
"lib/std-*.dll",
"lib/rustc-*.dll",
"lib/rustrt.dll",
"lib/rustllvm.dll"],
"bin/core-*.dll",
"bin/std-*.dll",
"bin/rustc-*.dll",
"bin/rustrt.dll",
"bin/rustllvm.dll"],
"freebsd": ["bin/rustc",
"lib/libcore-*.so",
"lib/libstd-*.so",