Merge pull request #57 from girlbossceo/patch-1

make sure the user has CMake installed
This commit is contained in:
0/0 2023-05-14 21:04:11 +00:00 committed by GitHub
commit 805dfcf36a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)