link ncman against zlib

This commit is contained in:
nick black 2021-12-06 01:10:14 -05:00 committed by nick black
parent f8b797f9db
commit 7ed70a7234
3 changed files with 5 additions and 7 deletions

View File

@ -96,6 +96,6 @@ steps:
- export TERM=xterm
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PANDOC=off ..
- cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PANDOC=off -DUSE_DOCTEST=off -DUSE_DEFLATE=off ..
- make -j2
- ctest --output-on-failure

View File

@ -653,16 +653,14 @@ target_include_directories(ncman
src
"${CMAKE_REQUIRED_INCLUDES}"
"${PROJECT_BINARY_DIR}/include"
)
target_include_directories(ncman
BEFORE
PRIVATE
"${libdeflate_INCLUDE_DIRS}"
"${ZLIB_INCLUDE_DIRS}"
)
target_link_libraries(ncman
PRIVATE
notcurses-core
"${libdeflate}"
"${ZLIB_LIBRARIES}"
)
endif()

View File

@ -78,7 +78,7 @@ map_gzipped_data(unsigned char* buf, size_t* len, unsigned char* ubuf, uint32_t
.zfree = Z_NULL,
.opaque = Z_NULL,
.next_in = buf,
.avail_in = len,
.avail_in = *len,
.next_out = ubuf,
.avail_out = ulen,
};
@ -87,7 +87,7 @@ map_gzipped_data(unsigned char* buf, size_t* len, unsigned char* ubuf, uint32_t
munmap(buf, *len);
return NULL;
}
r = inflate(&z, Z_FLUSH);
r = inflate(&z, Z_FINISH);
munmap(buf, *len);
if(r != Z_STREAM_END){
inflateEnd(&z);