fix(build): add -Wl rustc-cdylib-link-arg on macOS

This commit is contained in:
LongYinan 2020-08-26 17:58:42 +08:00
parent 95f94b4670
commit c229b26fa7
No known key found for this signature in database
GPG key ID: A3FFE134A3E20881
2 changed files with 2 additions and 1 deletions

View file

@ -60,6 +60,7 @@ cfg_if! {
} else if #[cfg(target_os = "macos")] {
/// Set up the build environment by setting Cargo configuration variables.
pub fn setup() {
println!("cargo:rustc-cdylib-link-arg=-Wl");
println!("cargo:rustc-cdylib-link-arg=-undefined");
println!("cargo:rustc-cdylib-link-arg=dynamic_lookup");
setup_napi_feature();

View file

@ -3,7 +3,7 @@
"version": "1.0.0",
"scripts": {
"build": "cargo build && node ../scripts/index.js build ./index",
"build-release": "cargo build --release && node ../scripts/napi.js build --release ./index",
"build-release": "cargo build --release && node ../scripts/index.js build --release ./index",
"test": "node ./index.js"
}
}