From: Daniel Bevenius Date: Tue, 25 Mar 2025 17:01:18 +0000 (+0100) Subject: whisper.android : add GGML_USE_CPU compile definition (#2945) X-Git-Tag: upstream/1.7.5~110 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=996581c5e2cc5af24496fbc5c0e73703d3bd536f;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp whisper.android : add GGML_USE_CPU compile definition (#2945) 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. --- diff --git a/examples/whisper.android/lib/src/main/jni/whisper/CMakeLists.txt b/examples/whisper.android/lib/src/main/jni/whisper/CMakeLists.txt index 9bf4c669..02309289 100644 --- a/examples/whisper.android/lib/src/main/jni/whisper/CMakeLists.txt +++ b/examples/whisper.android/lib/src/main/jni/whisper/CMakeLists.txt @@ -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)