diff --git a/Cargo.toml b/Cargo.toml index 5d3f1dd..189b8c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,4 +27,5 @@ regex = "1" [features] default = ["macros"] -macros = [] \ No newline at end of file +macros = [] +dylib = [] diff --git a/build/bind.rs b/build/bind.rs index ea41907..96f1691 100644 --- a/build/bind.rs +++ b/build/bind.rs @@ -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