mirror of
https://github.com/trabucayre/openFPGALoader.git
synced 2026-09-02 02:58:06 +02:00
CMakeList/configBitstreamParser: add optional zlib-ng support. No zlibxx is required
This commit is contained in:
+11
-1
@@ -37,11 +37,21 @@ if(USE_PKGCONFIG)
|
||||
pkg_check_modules(LIBFTDI REQUIRED libftdi1)
|
||||
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
|
||||
pkg_check_modules(HIDAPI hidapi-hidraw)
|
||||
pkg_check_modules(ZLIB zlib)
|
||||
# if hidraw not found try with libusb
|
||||
if(NOT HIDAPI_FOUND)
|
||||
pkg_check_modules(HIDAPI hidapi-libusb)
|
||||
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)
|
||||
pkg_check_modules(LIBUDEV libudev)
|
||||
|
||||
@@ -11,8 +11,16 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#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>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "display.hpp"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user