]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper.android : add GGML_USE_CPU compile definition (#2945)
authorDaniel Bevenius <redacted>
Tue, 25 Mar 2025 17:01:18 +0000 (18:01 +0100)
committerGitHub <redacted>
Tue, 25 Mar 2025 17:01:18 +0000 (18:01 +0100)
This commit add GGML_USE_CPU to built target library to enable CPU
backend.

The motivation for this that without the compile definition the CPU
backend is not enabled and the app will crash when trying to use it.

examples/whisper.android/lib/src/main/jni/whisper/CMakeLists.txt

index 9bf4c6695601097614522d0e88576040bd3c496e..023092890db2f6a0f09c30c1eaf0bafc2d6bf788 100644 (file)
@@ -44,6 +44,8 @@ function(build_library target_name)
         ${SOURCE_FILES}
     )
 
+    target_compile_definitions(${target_name} PUBLIC GGML_USE_CPU)
+
     if (${target_name} STREQUAL "whisper_v8fp16_va")
         target_compile_options(${target_name} PRIVATE -march=armv8.2-a+fp16)
         set(GGML_COMPILE_OPTIONS                      -march=armv8.2-a+fp16)