Skip to content

Commit 226d344

Browse files
authored
whisper.android.java : update build with ggml source changes (ggml-org#2942)
* 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.
1 parent bb9f681 commit 226d344

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

examples/whisper.android.java/app/src/main/jni/whisper/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@ cmake_minimum_required(VERSION 3.10)
22

33
project(whisper.cpp)
44

5-
set(CMAKE_CXX_STANDARD 11)
5+
set(CMAKE_CXX_STANDARD 17)
66
set(WHISPER_LIB_DIR ${CMAKE_SOURCE_DIR}/../../../../../../../)
77

88
set(SOURCE_FILES
99
${WHISPER_LIB_DIR}/ggml/src/ggml.c
10-
${WHISPER_LIB_DIR}/ggml/src/ggml-aarch64.c
10+
${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu.c
11+
${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
12+
${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-traits.cpp
13+
${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-quants.c
14+
${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu.cpp
1115
${WHISPER_LIB_DIR}/ggml/src/ggml-alloc.c
1216
${WHISPER_LIB_DIR}/ggml/src/ggml-backend.cpp
17+
${WHISPER_LIB_DIR}/ggml/src/ggml-backend-reg.cpp
1318
${WHISPER_LIB_DIR}/ggml/src/ggml-quants.c
19+
${WHISPER_LIB_DIR}/ggml/src/ggml-threading.cpp
1420
${WHISPER_LIB_DIR}/src/whisper.cpp
1521
${CMAKE_SOURCE_DIR}/jni.c
1622
)
@@ -25,6 +31,7 @@ function(build_library target_name)
2531
)
2632

2733
target_link_libraries(${target_name} ${LOG_LIB} android)
34+
target_compile_definitions(${target_name} PUBLIC GGML_USE_CPU)
2835

2936
if (${target_name} STREQUAL "whisper_v8fp16_va")
3037
target_compile_options(${target_name} PRIVATE -march=armv8.2-a+fp16)
@@ -57,3 +64,4 @@ include_directories(${WHISPER_LIB_DIR}/src)
5764
include_directories(${WHISPER_LIB_DIR}/include)
5865
include_directories(${WHISPER_LIB_DIR}/ggml/include)
5966
include_directories(${WHISPER_LIB_DIR}/ggml/src)
67+
include_directories(${WHISPER_LIB_DIR}/ggml/src/ggml-cpu)

examples/whisper.android.java/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ allprojects {
1616
repositories {
1717
google()
1818
jcenter()
19+
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
1920
}
2021
}
2122

2223
task clean(type: Delete) {
2324
delete rootProject.buildDir
24-
}
25+
}

examples/whisper.android.java/gradlew

100644100755
File mode changed.

0 commit comments

Comments
 (0)