]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper.android.java : update build with ggml source changes (#2942)
authorDaniel Bevenius <redacted>
Tue, 25 Mar 2025 15:01:59 +0000 (16:01 +0100)
committerGitHub <redacted>
Tue, 25 Mar 2025 15:01:59 +0000 (16:01 +0100)
* whisper.android.java : update build with ggml source changes

This commit updates the whisper.android.java build to include the
new ggml source files and directories. The gradle build configuration is
also updated to include the aliyun maven repository.

examples/whisper.android.java/app/src/main/jni/whisper/CMakeLists.txt
examples/whisper.android.java/build.gradle
examples/whisper.android.java/gradlew [changed mode: 0644->0755]

index 91007252f52e504011eb87b0d48c427bdd05956d..1ea30917a62ae99a5995288721f7f884b0aaa3df 100644 (file)
@@ -2,15 +2,21 @@ cmake_minimum_required(VERSION 3.10)
 
 project(whisper.cpp)
 
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
 set(WHISPER_LIB_DIR ${CMAKE_SOURCE_DIR}/../../../../../../../)
 
 set(SOURCE_FILES
     ${WHISPER_LIB_DIR}/ggml/src/ggml.c
-    ${WHISPER_LIB_DIR}/ggml/src/ggml-aarch64.c
+    ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu.c
+    ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
+    ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-traits.cpp
+    ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-quants.c
+    ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu.cpp
     ${WHISPER_LIB_DIR}/ggml/src/ggml-alloc.c
     ${WHISPER_LIB_DIR}/ggml/src/ggml-backend.cpp
+    ${WHISPER_LIB_DIR}/ggml/src/ggml-backend-reg.cpp
     ${WHISPER_LIB_DIR}/ggml/src/ggml-quants.c
+    ${WHISPER_LIB_DIR}/ggml/src/ggml-threading.cpp
     ${WHISPER_LIB_DIR}/src/whisper.cpp
     ${CMAKE_SOURCE_DIR}/jni.c
     )
@@ -25,6 +31,7 @@ function(build_library target_name)
     )
 
     target_link_libraries(${target_name} ${LOG_LIB} android)
+    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)
@@ -57,3 +64,4 @@ include_directories(${WHISPER_LIB_DIR}/src)
 include_directories(${WHISPER_LIB_DIR}/include)
 include_directories(${WHISPER_LIB_DIR}/ggml/include)
 include_directories(${WHISPER_LIB_DIR}/ggml/src)
+include_directories(${WHISPER_LIB_DIR}/ggml/src/ggml-cpu)
index 450441ac9098ecf05e032f95d370600f68863252..cc32112cf61cf4d31a6294ff614a530bf4345cce 100644 (file)
@@ -16,9 +16,10 @@ allprojects {
   repositories {
     google()
     jcenter()
+    maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
   }
 }
 
 task clean(type: Delete) {
   delete rootProject.buildDir
-}
\ No newline at end of file
+}
old mode 100644 (file)
new mode 100755 (executable)