Skip to content

Commit

Permalink
zlib -> libdeflate (#1)
Browse files Browse the repository at this point in the history
* zlib -> libdeflate

* makefile
  • Loading branch information
cldellow authored Oct 6, 2024
1 parent 2107305 commit c5286dd
Show file tree
Hide file tree
Showing 46 changed files with 14,707 additions and 83 deletions.
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ IF (TILESMUSH_BUILD_STATIC)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
ENDIF ()

find_package(ZLIB REQUIRED)

set(CMAKE_CXX_STANDARD 17)

if(!TM_VERSION)
Expand All @@ -45,6 +43,20 @@ endif()

file(GLOB tilesmush_src_files
src/coordinates.cpp
src/external/streamvbyte_decode.c
src/external/streamvbyte_encode.c
src/external/streamvbyte_zigzag.c
src/external/libdeflate/lib/adler32.c
src/external/libdeflate/lib/arm/cpu_features.c
src/external/libdeflate/lib/crc32.c
src/external/libdeflate/lib/deflate_compress.c
src/external/libdeflate/lib/deflate_decompress.c
src/external/libdeflate/lib/gzip_compress.c
src/external/libdeflate/lib/gzip_decompress.c
src/external/libdeflate/lib/utils.c
src/external/libdeflate/lib/x86/cpu_features.c
src/external/libdeflate/lib/zlib_compress.c
src/external/libdeflate/lib/zlib_decompress.c
src/helpers.cpp
src/mbtiles.cpp
src/tile_coordinates_set.cpp
Expand All @@ -56,7 +68,6 @@ target_include_directories(tile-smush PRIVATE ${CMAKE_BINARY_DIR}) # for generat
target_link_libraries(tile-smush
${THREAD_LIB} ${CMAKE_DL_LIBS}
SQLite::SQLite3
ZLIB::ZLIB
)

include(CheckCxxAtomic)
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ LABEL Description="Tilemaker" Version="1.4.0"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
libsqlite3-dev \
cmake \
zlib1g-dev && \
cmake && \
rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app
Expand Down
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MANPREFIX := /usr/share/man
TM_VERSION ?= $(shell git describe --tags --abbrev=0)
CXXFLAGS ?= -g -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c++14 -pthread -fPIE -DTM_VERSION=$(TM_VERSION) $(CONFIG)
CFLAGS ?= -g -O3 -Wall -Wno-unknown-pragmas -Wno-sign-compare -std=c99 -fPIE -DTM_VERSION=$(TM_VERSION) $(CONFIG)
LIB := -L$(PLATFORM_PATH)/lib -lz -lsqlite3 -pthread
LIB := -L$(PLATFORM_PATH)/lib -lsqlite3 -pthread
INC := -I$(PLATFORM_PATH)/include -isystem ./include -I./src

# Targets
Expand All @@ -18,6 +18,17 @@ all: tilesmush

tilesmush: \
src/coordinates.o \
src/external/libdeflate/lib/adler32.o \
src/external/libdeflate/lib/arm/cpu_features.o \
src/external/libdeflate/lib/crc32.o \
src/external/libdeflate/lib/deflate_compress.o \
src/external/libdeflate/lib/deflate_decompress.o \
src/external/libdeflate/lib/gzip_compress.o \
src/external/libdeflate/lib/gzip_decompress.o \
src/external/libdeflate/lib/utils.o \
src/external/libdeflate/lib/x86/cpu_features.o \
src/external/libdeflate/lib/zlib_compress.o \
src/external/libdeflate/lib/zlib_decompress.o \
src/helpers.o \
src/mbtiles.o \
src/tile_coordinates_set.o \
Expand All @@ -29,6 +40,17 @@ test: \

test_helpers: \
src/helpers.o \
src/external/libdeflate/lib/adler32.o \
src/external/libdeflate/lib/arm/cpu_features.o \
src/external/libdeflate/lib/crc32.o \
src/external/libdeflate/lib/deflate_compress.o \
src/external/libdeflate/lib/deflate_decompress.o \
src/external/libdeflate/lib/gzip_compress.o \
src/external/libdeflate/lib/gzip_decompress.o \
src/external/libdeflate/lib/utils.o \
src/external/libdeflate/lib/x86/cpu_features.o \
src/external/libdeflate/lib/zlib_compress.o \
src/external/libdeflate/lib/zlib_decompress.o \
test/helpers.test.o
$(CXX) $(CXXFLAGS) -o test.helpers $^ $(INC) $(LIB) $(LDFLAGS) && ./test.helpers

Expand Down
Loading

0 comments on commit c5286dd

Please sign in to comment.