Skip to content

Commit

Permalink
Added a "dylib" feature flag, that enables linking with raylib
Browse files Browse the repository at this point in the history
dynamically instead of statically
  • Loading branch information
InvalidString committed Oct 16, 2023
1 parent e93f846 commit e3daf66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ regex = "1"

[features]
default = ["macros"]
macros = []
macros = []
dylib = []
7 changes: 6 additions & 1 deletion build/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ pub fn link_libs() {
}

// Link raylib itself
println!("cargo:rustc-link-lib=static=raylib");
if cfg!(feature = "dylib") {
println!("cargo:rustc-link-lib=dylib=raylib");
}
else {
println!("cargo:rustc-link-lib=static=raylib");
}
}

/// Generates `bindings.rs` file
Expand Down

0 comments on commit e3daf66

Please sign in to comment.