make sure the user has CMake installed

Signed-off-by: r3g_5z <june@girlboss.ceo>
This commit is contained in:
r3g_5z 2023-05-14 16:58:37 -04:00
parent c557529e5b
commit e475c85234
2 changed files with 14 additions and 4 deletions

View file

@ -37,3 +37,11 @@ rustflags = "-lc++ -l framework=Accelerate"
``` ```
See https://github.com/tazz4843/whisper-rs/pull/2 for more information. See https://github.com/tazz4843/whisper-rs/pull/2 for more information.
You also need to have CMake installed. You can obtain this using homebrew:
```
brew install cmake
```
CMake can also be installed from https://cmake.org/download/ but `cmake` binary needs to be in your PATH.

View file

@ -104,9 +104,11 @@ fn main() {
#[cfg(feature = "opencl")] #[cfg(feature = "opencl")]
cmd.arg("-DWHISPER_CLBLAST=ON"); cmd.arg("-DWHISPER_CLBLAST=ON");
let code = cmd.status().expect("Failed to run `cmake`"); let code = cmd
.status()
.expect("Failed to run `cmake` (is CMake installed?)");
if code.code() != Some(0) { if code.code() != Some(0) {
panic!("Failed to run `cmake`"); panic!("Failed to run `cmake` (is CMake installed?)");
} }
let code = std::process::Command::new("cmake") let code = std::process::Command::new("cmake")
@ -115,9 +117,9 @@ fn main() {
.arg("--config") .arg("--config")
.arg("Release") .arg("Release")
.status() .status()
.expect("Failed to build libwhisper.a"); .expect("Failed to build libwhisper.a (is CMake installed?)");
if code.code() != Some(0) { if code.code() != Some(0) {
panic!("Failed to build libwhisper.a"); panic!("Failed to build libwhisper.a (is CMake installed?)");
} }
// move libwhisper.a to where Cargo expects it (OUT_DIR) // move libwhisper.a to where Cargo expects it (OUT_DIR)