From e5a410165da3afce5d931204f3b969704af59435 Mon Sep 17 00:00:00 2001 From: Pyry Kontio Date: Wed, 1 Mar 2017 19:56:53 +0200 Subject: [PATCH 1/2] Moved the system lib check not to prevent taking the static linking branch. --- src/lib.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 079fe3a..4e5393a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -430,18 +430,25 @@ impl Library { } "-l" => { self.libs.push(val.to_string()); - if statik && !is_system(val, &dirs) { - let meta = format!("rustc-link-lib=static={}", val); - config.print_metadata(&meta); - } else { - let meta = format!("rustc-link-lib={}", val); - config.print_metadata(&meta); - } } _ => {} } } + for val in &self.libs { + if statik { + if is_system(val, &dirs) { + panic!("The library \"{}\" is a system library, \ + which means it can't be linked statically!", val); + } + let meta = format!("rustc-link-lib=static={}", val); + config.print_metadata(&meta); + } else { + let meta = format!("rustc-link-lib={}", val); + config.print_metadata(&meta); + } + } + let mut iter = output.trim_right().split(' '); while let Some(part) = iter.next() { if part != "-framework" { From cd7c3b102da353269b7290961addf3ad7e120a71 Mon Sep 17 00:00:00 2001 From: Pyry Kontio Date: Wed, 1 Mar 2017 22:30:48 +0200 Subject: [PATCH 2/2] Fixed idents --- src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4e5393a..037b836 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -438,15 +438,15 @@ impl Library { for val in &self.libs { if statik { if is_system(val, &dirs) { - panic!("The library \"{}\" is a system library, \ - which means it can't be linked statically!", val); - } - let meta = format!("rustc-link-lib=static={}", val); - config.print_metadata(&meta); - } else { - let meta = format!("rustc-link-lib={}", val); - config.print_metadata(&meta); + panic!("The library \"{}\" is a system library, \ + which means it can't be linked statically!", val); } + let meta = format!("rustc-link-lib=static={}", val); + config.print_metadata(&meta); + } else { + let meta = format!("rustc-link-lib={}", val); + config.print_metadata(&meta); + } } let mut iter = output.trim_right().split(' ');