rustbuild: Build tests with LLD if use-lld = true was passed (non-msvc)

This commit is contained in:
Vadim Petrochenkov 2020-09-06 20:44:50 +03:00
parent 77d11c3ce2
commit 8e6b563b93

View file

@ -1067,10 +1067,16 @@ impl Step for Compiletest {
let mut hostflags = flags.clone();
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
if builder.config.use_lld && !compiler.host.triple.contains("msvc") {
hostflags.push("-Clink-args=-fuse-ld=lld".to_string());
}
cmd.arg("--host-rustcflags").arg(hostflags.join(" "));
let mut targetflags = flags;
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
if builder.config.use_lld && !target.contains("msvc") {
targetflags.push("-Clink-args=-fuse-ld=lld".to_string());
}
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
cmd.arg("--docck-python").arg(builder.python());