Skip to content

Commit

Permalink
Workaround macos ld
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Nov 23, 2020
1 parent 3902a1f commit 59f9fd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,19 +592,19 @@ pub fn ctest(
use std::ffi::OsString;
let static_lib_path = build_targets.static_lib.unwrap();
let builddir = static_lib_path.parent().unwrap();
let static_lib = static_lib_path.file_name().unwrap();

let mut ldflags = OsString::from("-L");
ldflags.push(builddir);
ldflags.push(" -l:");
ldflags.push(static_lib);
ldflags.push(" ");
ldflags.push(static_libs);

std::env::set_var("INLINE_C_RS_LDFLAGS", ldflags);

let mut cflags = OsString::from("-I");
cflags.push(builddir);
cflags.push(" ");
// We push the full path here to work around macos ld not supporting the -l:{filename} syntax
cflags.push(static_lib_path);

std::env::set_var("INLINE_C_RS_CFLAGS", cflags);

Expand Down

0 comments on commit 59f9fd1

Please sign in to comment.