37 lines
872 B
CMake
37 lines
872 B
CMake
include_directories(${CMAKE_SOURCE_DIR})
|
|
|
|
if(NOT DEFINED ANDROID_ABI)
|
|
if(NOT DEFINED ENV{JAVA_HOME})
|
|
message(FATAL_ERROR "Please set the environment variable JAVA_HOME")
|
|
endif()
|
|
include_directories($ENV{JAVA_HOME}/include)
|
|
include_directories($ENV{JAVA_HOME}/include/linux)
|
|
include_directories($ENV{JAVA_HOME}/include/darwin)
|
|
endif()
|
|
|
|
set(sources
|
|
audio-tagging.cc
|
|
jni.cc
|
|
keyword-spotter.cc
|
|
offline-recognizer.cc
|
|
offline-stream.cc
|
|
online-recognizer.cc
|
|
online-stream.cc
|
|
speaker-embedding-extractor.cc
|
|
speaker-embedding-manager.cc
|
|
spoken-language-identification.cc
|
|
voice-activity-detector.cc
|
|
wave-reader.cc
|
|
)
|
|
|
|
if(SHERPA_ONNX_ENABLE_TTS)
|
|
list(APPEND sources
|
|
offline-tts.cc
|
|
)
|
|
endif()
|
|
|
|
add_library(sherpa-onnx-jni ${sources})
|
|
|
|
target_link_libraries(sherpa-onnx-jni sherpa-onnx-core)
|
|
install(TARGETS sherpa-onnx-jni DESTINATION lib)
|