1
Fork 0

auto merge of #15869 : alexcrichton/rust/issue-15828, r=kballard

Closes #15828
This commit is contained in:
bors 2014-07-22 19:41:13 +00:00
commit bc6bbc3db1
2 changed files with 14 additions and 4 deletions

View file

@ -937,7 +937,16 @@ pub fn filename_for_input(sess: &Session,
config::CrateTypeStaticlib => { config::CrateTypeStaticlib => {
out_filename.with_filename(format!("lib{}.a", libname)) out_filename.with_filename(format!("lib{}.a", libname))
} }
config::CrateTypeExecutable => out_filename.clone(), config::CrateTypeExecutable => {
match sess.targ_cfg.os {
abi::OsWin32 => out_filename.with_extension("exe"),
abi::OsMacos |
abi::OsLinux |
abi::OsAndroid |
abi::OsFreebsd |
abi::OsiOS => out_filename.clone(),
}
}
} }
} }

View file

@ -2,8 +2,9 @@
all: all:
[ `$(RUSTC) --print-crate-name crate.rs` = "foo" ] [ `$(RUSTC) --print-crate-name crate.rs` = "foo" ]
[ `$(RUSTC) --print-file-name crate.rs` = "foo" ] [ `$(RUSTC) --print-file-name crate.rs` = "$(call BIN,foo)" ]
[ `$(RUSTC) --print-file-name --crate-type=lib --test crate.rs` = "foo" ] [ `$(RUSTC) --print-file-name --crate-type=lib \
[ `$(RUSTC) --print-file-name --test lib.rs` = "mylib" ] --test crate.rs` = "$(call BIN,foo)" ]
[ `$(RUSTC) --print-file-name --test lib.rs` = "$(call BIN,mylib)" ]
$(RUSTC) --print-file-name lib.rs $(RUSTC) --print-file-name lib.rs
$(RUSTC) --print-file-name rlib.rs $(RUSTC) --print-file-name rlib.rs