提交 6ebbc6c4 编写于 作者: A Alex Crichton

rustc: Append platform exe suffix to output files

Closes #15828
上级 df997e53
......@@ -937,7 +937,16 @@ pub fn filename_for_input(sess: &Session,
config::CrateTypeStaticlib => {
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(),
}
}
}
}
......
......@@ -2,8 +2,9 @@
all:
[ `$(RUSTC) --print-crate-name crate.rs` = "foo" ]
[ `$(RUSTC) --print-file-name crate.rs` = "foo" ]
[ `$(RUSTC) --print-file-name --crate-type=lib --test crate.rs` = "foo" ]
[ `$(RUSTC) --print-file-name --test lib.rs` = "mylib" ]
[ `$(RUSTC) --print-file-name crate.rs` = "$(call BIN,foo)" ]
[ `$(RUSTC) --print-file-name --crate-type=lib \
--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 rlib.rs
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册