Skip to content

Commit

Permalink
prefer dynamic linking for macOS targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachid Mzannar authored and Rachid Mzannar committed Dec 3, 2024
1 parent 8177cc1 commit f7be2d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,12 @@ impl LinkingPreferences {
);
}

// if no preference is given, default to prefer static linking
let prefer_static = prefer_static || !(prefer_dynamic || force_static || force_dynamic);
// if no preference is given, default to prefer static linking or dynamic linking for macOS
// targets
let prefer_static = match target_os_is("macos") {
true => false,
false => prefer_static || !(prefer_dynamic || force_static || force_dynamic),
};

LinkingPreferences {
prefer_static: force_static || prefer_static,
Expand Down

0 comments on commit f7be2d8

Please sign in to comment.