Skip to content

Commit 405017a

Browse files
committed
refactor flags
1 parent 904e897 commit 405017a

File tree

1 file changed

+9
-11
lines changed
  • src/tools/run-make-support/src/external_deps

1 file changed

+9
-11
lines changed

src/tools/run-make-support/src/external_deps/rustc.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl Rustc {
346346
// endif
347347
// endif
348348
// ```
349-
let flag = if is_windows() {
349+
if is_windows() {
350350
// So this is a bit hacky: we can't use the DLL version of libstdc++ because
351351
// it pulls in the DLL version of libgcc, which means that we end up with 2
352352
// instances of the DW2 unwinding implementation. This is a problem on
@@ -362,21 +362,19 @@ impl Rustc {
362362
// So we end up with the following hack: we link use static:-bundle to only
363363
// link the parts of libstdc++ that we actually use, which doesn't include
364364
// the dependency on the pthreads DLL.
365-
if is_msvc() { None } else { Some("-lstatic:-bundle=stdc++") }
365+
if !is_msvc() {
366+
self.cmd.arg("-lstatic:-bundle=stdc++");
367+
};
366368
} else if is_darwin() {
367-
Some("-lc++")
369+
self.cmd.arg("-lc++");
368370
} else if is_aix() {
369371
self.cmd.arg("-lc++");
370-
Some("-lc++abi")
372+
self.cmd.arg("-lc++abi");
371373
} else {
372-
match &uname()[..] {
373-
"FreeBSD" | "SunOS" | "OpenBSD" => None,
374-
_ => Some("-lstdc++"),
375-
}
374+
if !matches!(&uname()[..], "FreeBSD" | "SunOS" | "OpenBSD") {
375+
self.cmd.arg("-lstdc++");
376+
};
376377
};
377-
if let Some(flag) = flag {
378-
self.cmd.arg(flag);
379-
}
380378
self
381379
}
382380
}

0 commit comments

Comments
 (0)