-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from kiwix/adapt_wrapper
Adapt wrapper to new API of libzim/libkiwix
- Loading branch information
Showing
59 changed files
with
2,568 additions
and
1,493 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.gradle | ||
local.properties | ||
build | ||
lib/.cxx |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) | ||
cmake_minimum_required(VERSION 3.18.1) | ||
|
||
set(CMAKE_ANDROID_STL_TYPE llvm-libc++_static) | ||
|
||
project("libkiwix_wrapper") | ||
|
||
add_library( | ||
zim_wrapper | ||
|
||
SHARED | ||
libzim/archive.cpp | ||
libzim/entry.cpp | ||
libzim/entry_iterator.cpp | ||
libzim/item.cpp | ||
libzim/blob.cpp | ||
libzim/searcher.cpp | ||
libzim/query.cpp | ||
libzim/search.cpp | ||
libzim/search_iterator.cpp | ||
libzim/suggestion_searcher.cpp | ||
libzim/suggestion_search.cpp | ||
libzim/suggestion_iterator.cpp | ||
libzim/suggestion_item.cpp | ||
) | ||
|
||
find_library(libzim | ||
zim | ||
PATHS | ||
${BUILD_DIR}/jniLibs/${CMAKE_ANDROID_ARCH_ABI}/libzim) | ||
if (NOT libzim) | ||
message(FATAL_ERROR "libzim not found!") | ||
endif() | ||
add_library(libzim SHARED IMPORTED) | ||
|
||
set_property(TARGET | ||
libzim | ||
PROPERTY | ||
IMPORTED_LOCATION | ||
${BUILD_DIR}/jniLibs/${CMAKE_ANDROID_ARCH_ABI}/libzim/libzim.so) | ||
|
||
|
||
add_library( | ||
kiwix_wrapper | ||
|
||
SHARED | ||
libkiwix/book.cpp | ||
libkiwix/filter.cpp | ||
libkiwix/kiwixicu.cpp | ||
libkiwix/kiwixserver.cpp | ||
libkiwix/library.cpp | ||
libkiwix/bookmark.cpp | ||
libkiwix/manager.cpp | ||
libkiwix/illustration.cpp | ||
) | ||
|
||
find_library(libkiwix | ||
kiwix | ||
PATHS | ||
${BUILD_DIR}/jniLibs/${CMAKE_ANDROID_ARCH_ABI}/libkiwix) | ||
if (NOT libkiwix) | ||
message(FATAL_ERROR "libkiwix not found!") | ||
endif() | ||
add_library(libkiwix SHARED IMPORTED) | ||
|
||
set_property(TARGET | ||
libkiwix | ||
PROPERTY | ||
IMPORTED_LOCATION | ||
${BUILD_DIR}/jniLibs/${CMAKE_ANDROID_ARCH_ABI}/libkiwix/libkiwix.so) | ||
|
||
include_directories( | ||
${CMAKE_SOURCE_DIR} | ||
${BUILD_DIR}/include/libkiwix | ||
${BUILD_DIR}/include/libzim | ||
${BUILD_DIR}/include/javah_generated | ||
#${CMAKE_SOURCE_DIR}/include/utils | ||
) | ||
|
||
find_library( | ||
log-lib | ||
log) | ||
|
||
target_link_libraries( | ||
zim_wrapper | ||
libzim | ||
${log-lib} | ||
) | ||
|
||
target_link_libraries( | ||
kiwix_wrapper | ||
libkiwix | ||
libzim | ||
${log-lib} | ||
) | ||
|
Oops, something went wrong.