mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 17:33:07 +00:00
native lib: defer the duplicate check after relevant_lib check.
This commit is contained in:
parent
fc81ad22c4
commit
004614c4b3
@ -1805,13 +1805,14 @@ fn add_local_native_libraries(
|
|||||||
let search_path = archive_search_paths(sess);
|
let search_path = archive_search_paths(sess);
|
||||||
let mut last = (NativeLibKind::Unspecified, None);
|
let mut last = (NativeLibKind::Unspecified, None);
|
||||||
for lib in relevant_libs {
|
for lib in relevant_libs {
|
||||||
// Skip if this library is the same as the last.
|
|
||||||
last = if (lib.kind, lib.name) == last { continue } else { (lib.kind, lib.name) };
|
|
||||||
|
|
||||||
let name = match lib.name {
|
let name = match lib.name {
|
||||||
Some(l) => l,
|
Some(l) => l,
|
||||||
None => continue,
|
None => continue,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Skip if this library is the same as the last.
|
||||||
|
last = if (lib.kind, lib.name) == last { continue } else { (lib.kind, lib.name) };
|
||||||
|
|
||||||
let verbatim = lib.verbatim.unwrap_or(false);
|
let verbatim = lib.verbatim.unwrap_or(false);
|
||||||
match lib.kind {
|
match lib.kind {
|
||||||
NativeLibKind::Dylib { as_needed } => {
|
NativeLibKind::Dylib { as_needed } => {
|
||||||
@ -2144,9 +2145,6 @@ fn add_upstream_native_libraries(
|
|||||||
let mut last = (NativeLibKind::Unspecified, None);
|
let mut last = (NativeLibKind::Unspecified, None);
|
||||||
for &(cnum, _) in crates {
|
for &(cnum, _) in crates {
|
||||||
for lib in codegen_results.crate_info.native_libraries[&cnum].iter() {
|
for lib in codegen_results.crate_info.native_libraries[&cnum].iter() {
|
||||||
// Skip if this library is the same as the last.
|
|
||||||
last = if (lib.kind, lib.name) == last { continue } else { (lib.kind, lib.name) };
|
|
||||||
|
|
||||||
let name = match lib.name {
|
let name = match lib.name {
|
||||||
Some(l) => l,
|
Some(l) => l,
|
||||||
None => continue,
|
None => continue,
|
||||||
@ -2154,6 +2152,10 @@ fn add_upstream_native_libraries(
|
|||||||
if !relevant_lib(sess, &lib) {
|
if !relevant_lib(sess, &lib) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip if this library is the same as the last.
|
||||||
|
last = if (lib.kind, lib.name) == last { continue } else { (lib.kind, lib.name) };
|
||||||
|
|
||||||
let verbatim = lib.verbatim.unwrap_or(false);
|
let verbatim = lib.verbatim.unwrap_or(false);
|
||||||
match lib.kind {
|
match lib.kind {
|
||||||
NativeLibKind::Dylib { as_needed } => {
|
NativeLibKind::Dylib { as_needed } => {
|
||||||
|
Loading…
Reference in New Issue
Block a user