-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
201 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
examples/whisper.android/app/src/main/jni/whisper/Android.mk
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
examples/whisper.android/app/src/main/jni/whisper/Application.mk
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
examples/whisper.android/app/src/main/jni/whisper/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(whisper.cpp) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(WHISPER_LIB_DIR ${CMAKE_SOURCE_DIR}/../../../../../../../) | ||
|
||
set( | ||
SOURCE_FILES | ||
${WHISPER_LIB_DIR}/ggml.c | ||
${WHISPER_LIB_DIR}/whisper.cpp | ||
${CMAKE_SOURCE_DIR}/jni.c | ||
) | ||
|
||
if (${ANDROID_ABI} STREQUAL "arm64-v8a") | ||
set(WHISPER_LIBRARY_NAME whisper_v8fp16_va) | ||
elseif (${ANDROID_ABI} STREQUAL "armeabi-v7a") | ||
set(WHISPER_LIBRARY_NAME whisper_vfpv4) | ||
endif () | ||
|
||
add_library( | ||
${WHISPER_LIBRARY_NAME} | ||
SHARED | ||
${SOURCE_FILES} | ||
) | ||
|
||
if (${ANDROID_ABI} STREQUAL "arm64-v8a") | ||
target_compile_options(${WHISPER_LIBRARY_NAME} PRIVATE -march=armv8.2-a+fp16) | ||
elseif (${ANDROID_ABI} STREQUAL "armeabi-v7a") | ||
target_compile_options(${WHISPER_LIBRARY_NAME} PRIVATE -mfpu=neon-vfpv4) | ||
endif () | ||
|
||
|
||
target_link_libraries(${WHISPER_LIBRARY_NAME} log android) | ||
include_directories(${WHISPER_LIB_DIR}) | ||
|
||
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug") | ||
target_compile_options(${WHISPER_LIBRARY_NAME} PRIVATE -O3) | ||
target_compile_options(${WHISPER_LIBRARY_NAME} PRIVATE -fvisibility=hidden -fvisibility-inlines-hidden) | ||
target_compile_options(${WHISPER_LIBRARY_NAME} PRIVATE -ffunction-sections -fdata-sections) | ||
target_link_options(${WHISPER_LIBRARY_NAME} PRIVATE -Wl,--gc-sections) | ||
target_link_options(${WHISPER_LIBRARY_NAME} PRIVATE -Wl,--exclude-libs,ALL) | ||
target_link_options(${WHISPER_LIBRARY_NAME} PRIVATE -flto) | ||
endif () |
18 changes: 0 additions & 18 deletions
18
examples/whisper.android/app/src/main/jni/whisper/Whisper.mk
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.