diff --git a/src/model.rs b/src/model.rs index d70a53c6e..218a32f11 100644 --- a/src/model.rs +++ b/src/model.rs @@ -39,11 +39,27 @@ impl Model { // TASK: Read up why those calls are unsafe. Make sure calling them is // sound, and document why that is. let shape = unsafe { - let lib = libloading::Library::new(format!( - "{}/target/debug/lib{}.so", - self.path(), - self.name(), - ))?; + let lib = libloading::Library::new( + if cfg!(windows) { + format!( + "{}/target/debug/{}.dll", + self.path(), + self.name(), + ) + } else if cfg!(target_os = "macos") { + format!( + "{}/target/debug/lib{}.dylib", + self.path(), + self.name(), + ) + } else { //Unix + format!( + "{}/target/debug/lib{}.so", + self.path(), + self.name(), + ) + } + )?; let model: libloading::Symbol = lib.get(b"model")?; model(&arguments) };