Skip to content

Commit 956204f

Browse files
committed
Merge pull request #22 from Kroisse/master
Fix the bug that duplicating 'cargo:' prefix in OS X framework output, and other minor bugs.
2 parents 88d93b3 + 6629194 commit 956204f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ impl Library {
365365
}
366366

367367
fn parse_libs_cflags(&mut self, name: &str, output: &str, config: &Config) {
368-
let parts = output.split(' ')
368+
let parts = output.trim_right()
369+
.split(' ')
369370
.filter(|l| l.len() > 2)
370371
.map(|arg| (&arg[0..2], &arg[2..]))
371372
.collect::<Vec<_>>();
@@ -402,13 +403,13 @@ impl Library {
402403
}
403404
}
404405

405-
let mut iter = output.split(' ');
406+
let mut iter = output.trim_right().split(' ');
406407
while let Some(part) = iter.next() {
407408
if part != "-framework" {
408409
continue
409410
}
410411
if let Some(lib) = iter.next() {
411-
let meta = format!("cargo:rustc-link-lib=framework={}", lib);
412+
let meta = format!("rustc-link-lib=framework={}", lib);
412413
config.print_metadata(&meta);
413414
self.frameworks.push(lib.to_string());
414415
}

0 commit comments

Comments
 (0)