Skip to content

Commit

Permalink
create build files and compile for android and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
manuindersekhon committed Mar 27, 2021
1 parent 9cd359b commit 73246da
Show file tree
Hide file tree
Showing 8 changed files with 778 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"libc_deepspeech.h": "c",
"deepspeech.h": "c"
}
}
14 changes: 14 additions & 0 deletions libc_deepspeech/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CMakeFiles/
*.cmake
CMakeCache.txt
Makefile
CmakeScripts/
Project.build
Project.xcodeproj
XCBuildData/
.ninja*
*.ninja
.DS_Store
build_files/

!ios.toolchain.cmake
20 changes: 20 additions & 0 deletions libc_deepspeech/build/android/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.4.1)

# Library source files.
FILE(GLOB SRC ../../*.c)

# Add our own library, we will call it libcdeepspeech
add_library(deepspeechlibc SHARED ${SRC})
include_directories(../../)

# Include DeepSpeech 0.9.3
add_library(libdeepspeech SHARED IMPORTED)

# Get absolute path for desired architecture
get_filename_component(ABI_LIB_PATH ../../../libdeepspeech_0.9.3/android/${ANDROID_ABI}/libdeepspeech.so ABSOLUTE)

set_target_properties( libdeepspeech PROPERTIES IMPORTED_LOCATION ${ABI_LIB_PATH} )
include_directories( ../../../libdeepspeech_0.9.3/ )

# Link our library with deepspeech 0.9.3 library
target_link_libraries( deepspeechlibc libdeepspeech )
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions libc_deepspeech/build/ios/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.4.1)

# Library source files.
FILE(GLOB SRC ../../*.c)

add_library(deepspeechlibc STATIC ${SRC})
include_directories(../../)

# Find DeepSpeech 0.9.3 framework
find_library(DEEPSPEECH_LIB NAMES deepspeech_ios HINTS "../../../libdeepspeech_0.9.3")

# Link our library with DeepSpeech 0.9.3 framework
target_link_libraries(deepspeechlibc ${DEEPSPEECH_LIB})
Loading

0 comments on commit 73246da

Please sign in to comment.