Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
genya0407 committed Feb 29, 2024
1 parent 52bfe3a commit b8972ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions minutus-mruby-build-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ tar = "0.4.40"
reqwest = { version = "0.11.23", features = ["blocking"] }
flate2 = "1.*"
cc = "1.*"
regex = "1"
11 changes: 10 additions & 1 deletion minutus-mruby-build-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,16 @@ fn link_mruby(workdir: &Path) {
libs.trim()
);

println!("cargo:rustc-link-arg=-lmruby");
// For build on environments where `-Wl,--as-needed` is the default.
let re = regex::Regex::new(r"as-needed").unwrap();
let as_needed_supported = run_command(Path::new("."), &["ld", "--help"])
.unwrap()
.lines()
.any(|line| re.is_match(line));
if as_needed_supported {
println!("cargo:rustc-link-arg=-Wl,--no-as-needed");
}
println!("cargo:rustc-link-lib=mruby");
}

/// Downloads mruby source code from github.
Expand Down

0 comments on commit b8972ac

Please sign in to comment.