Skip to content

Commit

Permalink
Fix compile error on macos arm64.
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenlib committed Apr 28, 2024
1 parent 0ee76bf commit 7510e86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Rustup update stable
run: rustup update stable
- name: Show cargo version
run: cargo --version
run: cargo --version -v
- name: Build
run: cargo build --verbose
- name: Build tests
Expand Down
7 changes: 6 additions & 1 deletion lgbm-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ fn build_linux() {
}
}
fn build_macos() {
println!("cargo:rustc-link-lib=dylib=_lightgbm");
let target = env::var("CARGO_BUILD_TARGET").unwrap();
if target.contains("aarch64") {
println!("cargo:rustc-link-lib=dylib=lightgbm");
} else {
println!("cargo:rustc-link-lib=dylib=_lightgbm");
}
}

fn env_var(key: &str) -> String {
Expand Down

0 comments on commit 7510e86

Please sign in to comment.