Flatten if
s in rustc_codegen_ssa
This commit is contained in:
parent
9c67cecd12
commit
36f6bc5e3d
7 changed files with 81 additions and 98 deletions
|
@ -111,24 +111,22 @@ pub(crate) fn get_linker<'a>(
|
|||
// PATH for the child.
|
||||
let mut new_path = sess.get_tools_search_paths(self_contained);
|
||||
let mut msvc_changed_path = false;
|
||||
if sess.target.is_like_msvc {
|
||||
if let Some(ref tool) = msvc_tool {
|
||||
cmd.args(tool.args());
|
||||
for (k, v) in tool.env() {
|
||||
if k == "PATH" {
|
||||
new_path.extend(env::split_paths(v));
|
||||
msvc_changed_path = true;
|
||||
} else {
|
||||
cmd.env(k, v);
|
||||
}
|
||||
if sess.target.is_like_msvc
|
||||
&& let Some(ref tool) = msvc_tool
|
||||
{
|
||||
cmd.args(tool.args());
|
||||
for (k, v) in tool.env() {
|
||||
if k == "PATH" {
|
||||
new_path.extend(env::split_paths(v));
|
||||
msvc_changed_path = true;
|
||||
} else {
|
||||
cmd.env(k, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !msvc_changed_path {
|
||||
if let Some(path) = env::var_os("PATH") {
|
||||
new_path.extend(env::split_paths(&path));
|
||||
}
|
||||
if !msvc_changed_path && let Some(path) = env::var_os("PATH") {
|
||||
new_path.extend(env::split_paths(&path));
|
||||
}
|
||||
cmd.env("PATH", env::join_paths(new_path).unwrap());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue