CMakeList/configBitstreamParser: add optional zlib-ng support. No zlibxx is required
This commit is contained in:
parent
bfef127d9e
commit
9005b2880b
|
|
@ -37,11 +37,21 @@ if(USE_PKGCONFIG)
|
||||||
pkg_check_modules(LIBFTDI REQUIRED libftdi1)
|
pkg_check_modules(LIBFTDI REQUIRED libftdi1)
|
||||||
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
|
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
|
||||||
pkg_check_modules(HIDAPI hidapi-hidraw)
|
pkg_check_modules(HIDAPI hidapi-hidraw)
|
||||||
pkg_check_modules(ZLIB zlib)
|
|
||||||
# if hidraw not found try with libusb
|
# if hidraw not found try with libusb
|
||||||
if(NOT HIDAPI_FOUND)
|
if(NOT HIDAPI_FOUND)
|
||||||
pkg_check_modules(HIDAPI hidapi-libusb)
|
pkg_check_modules(HIDAPI hidapi-libusb)
|
||||||
endif()
|
endif()
|
||||||
|
# zlib support (gzip)
|
||||||
|
pkg_check_modules(ZLIB zlib)
|
||||||
|
if (NOT ZLIB_FOUND)
|
||||||
|
# try zlib-ng
|
||||||
|
pkg_check_modules(ZLIB zlib-ng)
|
||||||
|
if (ZLIB_FOUND)
|
||||||
|
add_definitions(-DHAS_ZLIBNG)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Could find ZLIB")
|
||||||
|
endif()
|
||||||
|
endif(NOT ZLIB_FOUND)
|
||||||
|
|
||||||
if(ENABLE_UDEV)
|
if(ENABLE_UDEV)
|
||||||
pkg_check_modules(LIBUDEV libudev)
|
pkg_check_modules(LIBUDEV libudev)
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,16 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAS_ZLIB
|
#ifdef HAS_ZLIB
|
||||||
|
#ifdef HAS_ZLIBNG
|
||||||
|
#include <zlib-ng.h>
|
||||||
|
#define z_stream zng_stream
|
||||||
|
#define inflateInit2(_strm, _windowBits) zng_inflateInit2(_strm, _windowBits)
|
||||||
|
#define inflate(_strm, __flush) zng_inflate(_strm, __flush)
|
||||||
|
#define inflateEnd(_strm) zng_inflateEnd(_strm)
|
||||||
|
#else
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "display.hpp"
|
#include "display.hpp"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue