Skip to content

generate dll file name based on target os. issue #4119 #4236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use core::os::consts instead of hard coded contant value
  • Loading branch information
ILyoan committed Dec 20, 2012
commit 0a7b730bbe1b0b4853743b46404ffc0145f8ccbf
13 changes: 9 additions & 4 deletions src/librustc/metadata/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use lib::llvm::{False, llvm, mk_object_file, mk_section_iter};
use metadata::filesearch::FileSearch;
use io::WriterUtil;
use syntax::parse::token::ident_interner;
use core::os::consts::{macos, freebsd, linux, win32};

export os;
export os_macos, os_win32, os_linux, os_freebsd;
Expand Down Expand Up @@ -67,10 +68,14 @@ fn find_library_crate(cx: ctxt) -> Option<{ident: ~str, data: @~[u8]}> {
fn libname(cx: ctxt) -> {prefix: ~str, suffix: ~str} {
if cx.static { return {prefix: ~"lib", suffix: ~".rlib"}; }
match cx.os {
os_win32 => return {prefix: ~"", suffix: ~".dll"},
os_macos => return {prefix: ~"lib", suffix: ~".dylib"},
os_linux => return {prefix: ~"lib", suffix: ~".so"},
os_freebsd => return {prefix: ~"lib", suffix: ~".so"}
os_win32 => return {prefix: win32::dll_prefix(),
suffix: win32::dll_suffix()},
os_macos => return {prefix: macos::dll_prefix(),
suffix: macos::dll_suffix()},
os_linux => return {prefix: linux::dll_prefix(),
suffix: linux::dll_suffix()},
os_freebsd => return {prefix: freebsd::dll_prefix(),
suffix: freebsd::dll_suffix()}
}
}

Expand Down