Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates from koreader/crengine #299

Merged
merged 88 commits into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
ea9e649
XML parsing: correctly parse CDATA (#397)
poire-z Dec 5, 2020
b0201d4
Based on https://github.com/koreader/crengine/pull/399: 3a28fe970b3c0…
virxkane May 25, 2021
9dc6fd9
Based on https://github.com/koreader/crengine/pull/399: b65f1e3bcaf56…
virxkane May 25, 2021
78b2561
LVTinyDom: Update xxHash to v0.8.0
NiLuJe Dec 4, 2020
eb3644d
File crengine/include/xxhash.h moved into crengine/src/ since it's pr…
virxkane May 25, 2021
a3c5843
Fix compile error after 892a22c4a7b5311591b17023a224c70c6b301260
virxkane May 25, 2021
a342f43
LVTinyDom: Port ldomPack/ldomUnpack to ZSTD
NiLuJe Dec 5, 2020
1cfe4b3
* crengine: enabled zstd cache compression.
virxkane May 27, 2021
7f61948
* add thirdparty `zstd` to repo.
virxkane May 28, 2021
617cf84
Android cmake project: rename all thirdparty bundled static libraries…
virxkane May 28, 2021
64fc974
Desktop: allow to build static library `zstd` if system one is not fo…
virxkane May 28, 2021
fe7a080
Get rid of RevRGB & co (#402)
NiLuJe Dec 23, 2020
dcc77dd
Android: optimized pixel format conversion from crengine BGRX to andr…
virxkane May 28, 2021
0da210c
EPUB: fix truncated HEAD>STYLE stylesheet
poire-z Dec 31, 2020
db7f67e
XML parsing: slightly better parsing of <script>
poire-z Dec 31, 2020
5f8c16a
Update German hyphenation patterns (#406)
zwim Jan 12, 2021
9f0ce43
Update German hyphenation patterns in android resources
virxkane May 28, 2021
72b99fa
LVDocView: Mark some getter functions as const.
virxkane May 31, 2021
5bc60e1
Header: add option to display time as 12-hours clock
poire-z Jan 25, 2021
1f1aaff
EPUB ncx TOC: allow items with an empty title
poire-z Jan 18, 2021
14379db
resizeImage(): restore original scaling options code
poire-z Jan 18, 2021
d8f6d09
CSS: parse and store min/max-width/height
poire-z Jan 18, 2021
15608a5
Add getStyledImageSize() ensuring min/max-width/height
poire-z Jan 18, 2021
fdddc7d
renderBlockElementEnhanced(): ensure min/max-width/height
poire-z Jan 18, 2021
52eb1ad
Add LVDocView::getDocumentRenderingHash()
poire-z Jan 25, 2021
26be90f
Mark LVDocView::getDocumentRenderingHash() as const.
virxkane May 31, 2021
731857f
CSS: add units vw vh vmin vmax
ourairquality Jan 27, 2021
38f688a
CSS max-height: apply to block elements
ourairquality Jan 30, 2021
832f114
getStyledImageSize(): tweak min/max-width/height computations
poire-z Feb 2, 2021
cf15ffd
getStyledImageSize(): don't ignore FB2/SVG <image> element
poire-z Feb 2, 2021
31c3918
getStyledImageSize(): hack to handle sizing via SVG wrappers
poire-z Feb 2, 2021
fd6fd3b
Fix max img height when small line-height
poire-z Feb 9, 2021
e1504f3
getRenderedWidths(): fix consecutive non-collapsable spaces
poire-z Feb 9, 2021
fc77590
CSS: adds support for "visibility: hidden"
poire-z Feb 9, 2021
b844dbb
Text: fix some bgcolor issues, handle fgcolor transparent
poire-z Feb 9, 2021
fc12d9c
remove global gRootFontSize
poire-z Feb 9, 2021
3790cef
LVString: Fix a c/p issue in lString8::atoi64
zwim Feb 16, 2021
2b38949
LVTextFm: Simplify and fix resizeImage logic
NiLuJe Feb 16, 2021
6464e87
LVXMLParser::ReadText(): fix parsing at buffer boundaries
poire-z Feb 22, 2021
bf038f2
TextLang: fix lang_tag first part comparison
poire-z Feb 22, 2021
d32591b
CSS font-family: fix parsing of 'inherit' and '!important'
poire-z Feb 22, 2021
c4bd5b2
CSS: support a few -epub-* and -webkit-* properties
poire-z Feb 22, 2021
dc70164
Text fragment flags: add LTEXT_HAS_EXTRA
poire-z Feb 22, 2021
af78726
CSS: add support for 'line-break' and 'word-break'
poire-z Feb 22, 2021
88ffbc6
Header: add symbol if charging when battery shown in % (#425)
zwim Mar 2, 2021
1d8551c
Based on https://github.com/koreader/crengine/pull/426: 4acb2ea34c6e0…
virxkane Jun 2, 2021
fc18c9d
Compile errors fixed that introduced in af7872641ca64bc305c1c872c44af…
virxkane Jun 2, 2021
bc62a23
LVString: fix ::insert(pos, count, char)
poire-z Mar 18, 2021
3243799
toStringV2(): fix (again) when target node is a boxing node
poire-z Mar 18, 2021
c58fad4
LVFontCache::find(): give more weight to first fonts in list
poire-z Mar 18, 2021
16c6623
Page splitting: more accurate rendering progress
poire-z Mar 18, 2021
9e801c7
getRenderedWidths(): fix nowrap around image/inlineBoxes
poire-z Mar 18, 2021
4d2ece7
Table cells getRenderedWidths(): provide rend_flags
poire-z Mar 18, 2021
798cf82
Tables rendering: tweak column widths algorithm
poire-z Mar 18, 2021
6fd22ac
CSS: parse/handle "currentcolor", default for border-color
poire-z Mar 18, 2021
0abeb69
CSS: add units 'ch' (just like 'ex')
poire-z Mar 18, 2021
426b303
SVG images: proper alpha blending
poire-z Mar 18, 2021
67f0e3a
Use the correct font glyph cache item size & glyph image offset.
virxkane Jun 8, 2021
81dd8c1
Images: allow <img src="data:image/svg;-cr-plain,content">
poire-z Mar 18, 2021
50f4064
CSS: properly handle selectors with internal boxing element names
poire-z Mar 18, 2021
a87643d
CSS ensure width on boxing element table sub-elements
poire-z Mar 18, 2021
5e66132
Add ldomNode::getAttributeValueLC()
poire-z Mar 18, 2021
229b5b8
MathML: adds LVInkMeasurementDrawBuf
poire-z Mar 18, 2021
f1d716d
MathML: Fonts: add getExtraMetric(), mostly for OpenType Math
poire-z Mar 18, 2021
5f3db13
Minor fixes for previous commit f1d716dc194bf8436964e15903c77b9126a9513d
virxkane Jun 9, 2021
6bce2e3
MathML: add MathML elements to fb2def.h
poire-z Mar 18, 2021
ba1ada2
MathML: add parsing and rendering support files
poire-z Mar 18, 2021
a12eb32
MathML: plug MathML code into crengine core
poire-z Mar 18, 2021
adffc27
MathML: Fonts: allow drawing stretched glyphs
poire-z Mar 18, 2021
984d743
Adapted last commit adffc2749acc0a2bef90740064216d94c43a8312 for Cool…
virxkane Jun 9, 2021
b61f163
Enable MathML for CoolReader.
virxkane Jun 9, 2021
436968d
Fix global-buffer-overflow.
virxkane Jun 9, 2021
69676c8
Fixed coolreader/crengine/src/lvstring.cpp:127:42: runtime error: sig…
virxkane Jun 9, 2021
58381dc
MathML: <epub:switch/case/default>: accept MathML
poire-z Mar 18, 2021
ec95484
Text: dont adjust space after consecutive initial marks/dashes
poire-z Mar 21, 2021
38d3aec
Update German hyphenation patterns (#431)
zwim Mar 22, 2021
f7d4740
Update German hyphenation patterns in android resources.
virxkane Jun 9, 2021
3ad3314
MathML: a few minor fixes
poire-z Apr 27, 2021
2f7e1aa
Fix hyphenation on Armenian and Georgian text (#436)
poire-z Apr 28, 2021
3d3702b
Added utf8proc library to dependencies & enabled.
virxkane Jun 10, 2021
9a78fdf
* add thirdparty `utf8proc` to repo.
virxkane Jun 10, 2021
0ec1371
fb2.css: ensure page break after <body>
poire-z May 14, 2021
6b0ea70
XML parsing: don't trim double spaces in attributes
poire-z May 14, 2021
2b80704
Fix ignore occasional space at start of line
poire-z May 14, 2021
2ad425d
lvtinydom.cpp: bool hasInvisibleParent(ldomNode* node): null pointer …
virxkane Jun 11, 2021
6f83962
Memory leak fixed:
virxkane Jun 11, 2021
7a8b182
Memory leak fixed:
virxkane Jun 11, 2021
7bc43c3
Memory leak fixed:
virxkane Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ endif(NOT MAC)

if (NOT ${GUI} STREQUAL FB2PROPS )
if (NOT MAC)

if (NOT MSVC AND NOT CR3_PNG)
FIND_PACKAGE(PNG)
endif (NOT MSVC AND NOT CR3_PNG)
Expand Down Expand Up @@ -306,6 +307,20 @@ if (NOT LIBUNIBREAK_FOUND)
SET(LIBUNIBREAK_LIBRARIES unibreak)
endif (NOT LIBUNIBREAK_FOUND)

find_package(ZSTD)
if (NOT ZSTD_FOUND)
message("\nSystem zstd not found, will build local one\n")
set(ZSTD_LEGACY_SUPPORT OFF CACHE BOOL "LEGACY SUPPORT" FORCE)
set(ZSTD_MULTITHREAD_SUPPORT OFF CACHE BOOL "MULTITHREADING SUPPORT" FORCE)
set(ZSTD_BUILD_PROGRAMS OFF CACHE BOOL "BUILD PROGRAMS" FORCE)
set(ZSTD_BUILD_CONTRIB OFF CACHE BOOL "BUILD CONTRIB" FORCE)
set(ZSTD_BUILD_TESTS OFF CACHE BOOL "BUILD TESTS" FORCE)
set(ZSTD_BUILD_STATIC ON CACHE BOOL "BUILD STATIC LIBRARIES" FORCE)
set(ZSTD_BUILD_SHARED OFF CACHE BOOL "BUILD SHARED LIBRARIES" FORCE)
add_subdirectory(thirdparty/${REPO_ZSTD_SRCDIR}/build/cmake)
SET(ZSTD_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/${REPO_ZSTD_SRCDIR}/lib CACHE PATH "Include directories needed to use ZSTD" FORCE)
SET(ZSTD_LIBRARIES libzstd_static CACHE FILEPATH "Libraries needed to link to ZSTD" FORCE)
endif(NOT ZSTD_FOUND)

endif (NOT MAC)

Expand Down Expand Up @@ -339,6 +354,7 @@ INCLUDE_DIRECTORIES(
${CHM_INCLUDE_DIR}
${FRIBIDI_INCLUDE_DIR}
${LIBUNIBREAK_INCLUDE_DIR}
${ZSTD_INCLUDE_DIRS}
)

if ( ${GUI} STREQUAL FB2PROPS )
Expand All @@ -357,6 +373,7 @@ SET(STD_LIBS
${ANTIWORD_LIBRARIES}
${FRIBIDI_LIBRARIES}
${LIBUNIBREAK_LIBRARIES}
${ZSTD_LIBRARIES}
qimagescale
)
if (FONTCONFIG_FOUND)
Expand Down
38 changes: 21 additions & 17 deletions android/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ include_directories(${CR3_ROOT}/thirdparty_unman/nanosvg/src)
include_directories(${CR3_ROOT}/thirdparty/${REPO_FRIBIDI_SRCDIR}/lib)
include_directories(thirdparty_libs/fribidi/lib)
include_directories(${CR3_ROOT}/thirdparty/${REPO_LIBUNIBREAK_SRCDIR}/src)
include_directories(${CR3_ROOT}/thirdparty/${REPO_ZSTD_SRCDIR}/lib)

add_definitions(-DLINUX=1 -D_LINUX=1 -DFOR_ANDROID=1 -DCR3_PATCH)
add_definitions(-DFT_CONFIG_MODULES_H=<android/config/ftmodule.h> -DFT_CONFIG_OPTIONS_H=<android/config/ftoption.h>)
Expand Down Expand Up @@ -90,6 +91,7 @@ set(CRENGINE_SRC_FILES
${CR3_ROOT}/crengine/src/lvrend.cpp
${CR3_ROOT}/crengine/src/wolutil.cpp
${CR3_ROOT}/crengine/src/crconcurrent.cpp
${CR3_ROOT}/crengine/src/mathml.cpp
${CR3_ROOT}/crengine/src/hist.cpp
${CR3_ROOT}/crengine/src/xxhash.c
${CR3_ROOT}/crengine/src/textlang.cpp
Expand Down Expand Up @@ -122,6 +124,7 @@ set(CRENGINE_SRC_FILES
${CR3_ROOT}/crengine/src/lvdrawbuf/lvbasedrawbuf.cpp
${CR3_ROOT}/crengine/src/lvdrawbuf/lvgraydrawbuf.cpp
${CR3_ROOT}/crengine/src/lvdrawbuf/lvcolordrawbuf.cpp
${CR3_ROOT}/crengine/src/lvdrawbuf/lvinkmeasurementdrawbuf.cpp
${CR3_ROOT}/crengine/src/lvdrawbuf/lvimagescaleddrawcallback.cpp
${CR3_ROOT}/crengine/src/lvdrawbuf/lvdrawbuf_utils.cpp
${CR3_ROOT}/crengine/src/lvstream/lvdefstreambuffer.cpp
Expand Down Expand Up @@ -211,20 +214,21 @@ find_library( # Sets the name of the path variable.
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
cr3engine-3-2-X

# thirdparty static libs
png
jpeg
freetype
harfbuzz
chmlib
antiword
fribidi
unibreak
qimagescale

# Links the target library to the log library
# included in the NDK.
${log-lib}
-lm -lz -ldl)
cr3engine-3-2-X

# thirdparty static libs
local_png
local_jpeg
local_freetype
local_harfbuzz
local_chmlib
local_antiword
local_fribidi
local_unibreak
local_qimagescale
local_zstd

# Links the target library to the log library
# included in the NDK.
${log-lib}
-lm -lz -ldl)
1 change: 1 addition & 0 deletions android/app/thirdparty_libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ add_subdirectory(antiword)
add_subdirectory(fribidi)
add_subdirectory(libunibreak)
add_subdirectory(qimagescale)
add_subdirectory(zstd)
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/antiword/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(antiword)
project(local_antiword)

set(ANTIWORD_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty_unman/antiword)

Expand Down Expand Up @@ -52,4 +52,4 @@ set(ANTIWORD_SRC_FILES
${ANTIWORD_SRC_DIR}/xmalloc.c
)

add_library(antiword STATIC ${ANTIWORD_SRC_FILES})
add_library(local_antiword STATIC ${ANTIWORD_SRC_FILES})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/chmlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(chmlib)
project(local_chmlib)

set(CHM_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty_unman/chmlib)

Expand All @@ -10,4 +10,4 @@ set(CHM_SRC_FILES
${CHM_SRC_DIR}/src/lzx.c
)

add_library(chmlib STATIC ${CHM_SRC_FILES})
add_library(local_chmlib STATIC ${CHM_SRC_FILES})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/freetype/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(freetype)
project(local_freetype)

set(FREETYPE_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty/${REPO_FREETYPE_SRCDIR})
set(FREETYPE_CONFIG_DIR ${PROJECT_SOURCE_DIR})
Expand Down Expand Up @@ -42,4 +42,4 @@ set(FREETYPE_SRC_FILES
# ${FREETYPE_SRC_DIR}/src/gxvalid/gxvalid.c
# ${FREETYPE_SRC_DIR}/src/otvalid/otvalid.c

add_library(freetype STATIC ${FREETYPE_SRC_FILES})
add_library(local_freetype STATIC ${FREETYPE_SRC_FILES})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/fribidi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(fribidi C)
project(local_fribidi C)

cmake_minimum_required(VERSION 3.4)

Expand Down Expand Up @@ -31,4 +31,4 @@ set(FRIBIDI_SOURCE
${FRIBIDI_SOURCE_DIR}/lib/fribidi-shape.c
)

add_library(fribidi STATIC ${FRIBIDI_SOURCE})
add_library(local_fribidi STATIC ${FRIBIDI_SOURCE})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/harfbuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(harfbuzz)
project(local_harfbuzz)

set(HARFBUZZ_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty/${REPO_HARFBUZZ_SRCDIR})
set(HARFBUZZ_CONFIG_DIR ${PROJECT_SOURCE_DIR})
Expand Down Expand Up @@ -61,4 +61,4 @@ set(HARFBUZZ_SRC_FILES
${HARFBUZZ_SRC_DIR}/src/hb-unicode.cc
)

add_library(harfbuzz STATIC ${HARFBUZZ_SRC_FILES})
add_library(local_harfbuzz STATIC ${HARFBUZZ_SRC_FILES})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/libjpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(jpeg)
project(local_jpeg)

set(JPEG_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty/${REPO_LIBJPEG_SRCDIR})

Expand Down Expand Up @@ -54,4 +54,4 @@ set(JPEG_SRC_FILES
${JPEG_SRC_DIR}/jmemnobs.c
)

add_library(jpeg STATIC ${JPEG_SRC_FILES})
add_library(local_jpeg STATIC ${JPEG_SRC_FILES})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/libpng/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(png)
project(local_png)

set(PNG_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty/${REPO_LIBPNG_SRCDIR})
set(PNG_CONFIG_DIR ${PROJECT_SOURCE_DIR})
Expand Down Expand Up @@ -103,4 +103,4 @@ set(PNG_SRC_FILES
${libpng_intel_sources}
)

add_library(png STATIC ${PNG_SRC_FILES})
add_library(local_png STATIC ${PNG_SRC_FILES})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/libunibreak/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(unibreak C)
project(local_unibreak C)

cmake_minimum_required(VERSION 3.4)

Expand All @@ -17,4 +17,4 @@ set(LIBUNIBREAK_SOURCE
${LIBUNIBREAK_SOURCE_DIR}/wordbreak.c
)

add_library(unibreak STATIC ${LIBUNIBREAK_SOURCE})
add_library(local_unibreak STATIC ${LIBUNIBREAK_SOURCE})
4 changes: 2 additions & 2 deletions android/app/thirdparty_libs/qimagescale/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(qimagescale)
project(local_qimagescale)

set(QIMAGESCALE_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty_unman/qimagescale)

Expand All @@ -9,4 +9,4 @@ set(QIMAGESCALE_SRC_FILES
${QIMAGESCALE_SRC_DIR}/qimagescale.cpp
)

add_library(qimagescale STATIC ${QIMAGESCALE_SRC_FILES})
add_library(local_qimagescale STATIC ${QIMAGESCALE_SRC_FILES})
47 changes: 47 additions & 0 deletions android/app/thirdparty_libs/zstd/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := local_zstd

ZSTD_SRC_DIR := ../../../../thirdparty/$(REPO_ZSTD_SRCDIR)
ZSTD_SRC_DIR_P := $(LOCAL_PATH)/../../../../thirdparty/$(REPO_ZSTD_SRCDIR)

LOCAL_C_INCLUDES := $(ZSTD_SRC_DIR_P)
LOCAL_CFLAGS += -funwind-tables -Wl,--no-merge-exidx-entries

LOCAL_CFLAGS += -DXXH_NAMESPACE=ZSTD_ -DZSTD_LEGACY_SUPPORT=0 -UZSTD_MULTITHREAD -DZSTD_NO_TRACE -DZSTD_TRACE=0

LOCAL_SRC_FILES := \
$(ZSTD_SRC_DIR)/lib/common/debug.c \
$(ZSTD_SRC_DIR)/lib/common/entropy_common.c \
$(ZSTD_SRC_DIR)/lib/common/error_private.c \
$(ZSTD_SRC_DIR)/lib/common/fse_decompress.c \
$(ZSTD_SRC_DIR)/lib/common/pool.c \
$(ZSTD_SRC_DIR)/lib/common/threading.c \
$(ZSTD_SRC_DIR)/lib/common/xxhash.c \
$(ZSTD_SRC_DIR)/lib/common/zstd_common.c \
$(ZSTD_SRC_DIR)/lib/compress/fse_compress.c \
$(ZSTD_SRC_DIR)/lib/compress/hist.c \
$(ZSTD_SRC_DIR)/lib/compress/huf_compress.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_compress.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_compress_literals.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_compress_sequences.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_compress_superblock.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_double_fast.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_fast.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_lazy.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_ldm.c \
$(ZSTD_SRC_DIR)/lib/compress/zstd_opt.c \
$(ZSTD_SRC_DIR)/lib/compress/zstdmt_compress.c \
$(ZSTD_SRC_DIR)/lib/decompress/huf_decompress.c \
$(ZSTD_SRC_DIR)/lib/decompress/zstd_ddict.c \
$(ZSTD_SRC_DIR)/lib/decompress/zstd_decompress.c \
$(ZSTD_SRC_DIR)/lib/decompress/zstd_decompress_block.c \
$(ZSTD_SRC_DIR)/lib/dictBuilder/cover.c \
$(ZSTD_SRC_DIR)/lib/dictBuilder/divsufsort.c \
$(ZSTD_SRC_DIR)/lib/dictBuilder/fastcover.c \
$(ZSTD_SRC_DIR)/lib/dictBuilder/zdict.c

include $(BUILD_STATIC_LIBRARY)
45 changes: 45 additions & 0 deletions android/app/thirdparty_libs/zstd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

project(local_zstd)

set(ZSTD_SRC_DIR ${PROJECT_SOURCE_DIR}/../../../../thirdparty/${REPO_ZSTD_SRCDIR})

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

add_definitions(-DXXH_NAMESPACE=ZSTD_)
add_definitions(-DZSTD_LEGACY_SUPPORT=0)
add_definitions(-UZSTD_MULTITHREAD)
add_definitions(-DZSTD_NO_TRACE -DZSTD_TRACE=0)

set(ZSTD_SRC_FILES
${ZSTD_SRC_DIR}/lib/common/debug.c
${ZSTD_SRC_DIR}/lib/common/entropy_common.c
${ZSTD_SRC_DIR}/lib/common/error_private.c
${ZSTD_SRC_DIR}/lib/common/fse_decompress.c
${ZSTD_SRC_DIR}/lib/common/pool.c
${ZSTD_SRC_DIR}/lib/common/threading.c
${ZSTD_SRC_DIR}/lib/common/xxhash.c
${ZSTD_SRC_DIR}/lib/common/zstd_common.c
${ZSTD_SRC_DIR}/lib/compress/fse_compress.c
${ZSTD_SRC_DIR}/lib/compress/hist.c
${ZSTD_SRC_DIR}/lib/compress/huf_compress.c
${ZSTD_SRC_DIR}/lib/compress/zstd_compress.c
${ZSTD_SRC_DIR}/lib/compress/zstd_compress_literals.c
${ZSTD_SRC_DIR}/lib/compress/zstd_compress_sequences.c
${ZSTD_SRC_DIR}/lib/compress/zstd_compress_superblock.c
${ZSTD_SRC_DIR}/lib/compress/zstd_double_fast.c
${ZSTD_SRC_DIR}/lib/compress/zstd_fast.c
${ZSTD_SRC_DIR}/lib/compress/zstd_lazy.c
${ZSTD_SRC_DIR}/lib/compress/zstd_ldm.c
${ZSTD_SRC_DIR}/lib/compress/zstd_opt.c
${ZSTD_SRC_DIR}/lib/compress/zstdmt_compress.c
${ZSTD_SRC_DIR}/lib/decompress/huf_decompress.c
${ZSTD_SRC_DIR}/lib/decompress/zstd_ddict.c
${ZSTD_SRC_DIR}/lib/decompress/zstd_decompress.c
${ZSTD_SRC_DIR}/lib/decompress/zstd_decompress_block.c
${ZSTD_SRC_DIR}/lib/dictBuilder/cover.c
${ZSTD_SRC_DIR}/lib/dictBuilder/divsufsort.c
${ZSTD_SRC_DIR}/lib/dictBuilder/fastcover.c
${ZSTD_SRC_DIR}/lib/dictBuilder/zdict.c
)

add_library(local_zstd STATIC ${ZSTD_SRC_FILES})
6 changes: 5 additions & 1 deletion android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LOCAL_C_INCLUDES := \
$(CR3_ROOT)/thirdparty_unman/nanosvg/src \
$(CR3_ROOT)/thirdparty/$(REPO_FRIBIDI_SRCDIR)/lib \
$(CR3_ROOT)/thirdparty/$(REPO_LIBUNIBREAK_SRCDIR)/src \
$(CR3_ROOT)/thirdparty/$(REPO_ZSTD_SRCDIR)/lib \
$(CR3_ROOT)/android/app/thirdparty_libs/freetype \
$(CR3_ROOT)/android/app/thirdparty_libs/fribidi/lib \
$(CR3_ROOT)/android/app/thirdparty_libs/libpng/lib
Expand Down Expand Up @@ -85,6 +86,7 @@ CRENGINE_SRC_FILES := \
../../crengine/src/lvrend.cpp \
../../crengine/src/wolutil.cpp \
../../crengine/src/crconcurrent.cpp \
../../crengine/src/mathml.cpp \
../../crengine/src/hist.cpp \
../../crengine/src/xxhash.c \
../../crengine/src/textlang.cpp \
Expand Down Expand Up @@ -117,6 +119,7 @@ CRENGINE_SRC_FILES := \
../../crengine/src/lvdrawbuf/lvbasedrawbuf.cpp \
../../crengine/src/lvdrawbuf/lvgraydrawbuf.cpp \
../../crengine/src/lvdrawbuf/lvcolordrawbuf.cpp \
../../crengine/src/lvdrawbuf/lvinkmeasurementdrawbuf.cpp \
../../crengine/src/lvdrawbuf/lvimagescaleddrawcallback.cpp \
../../crengine/src/lvdrawbuf/lvdrawbuf_utils.cpp \
../../crengine/src/lvstream/lvdefstreambuffer.cpp \
Expand Down Expand Up @@ -192,7 +195,8 @@ LOCAL_STATIC_LIBRARIES := \
local_antiword \
local_fribidi \
local_libunibreak \
local_qimagescale
local_qimagescale \
local_zstd

LOCAL_LDLIBS := -lm -llog -lz -ldl -flto
#
Expand Down
Loading