sisong / HDiffPatch

a C\C++ library and command-line tools for Diff & Patch between binary files or directories(folder); cross-platform; runs fast; create small delta/differential; support large files and limit memory requires when diff & patch.
Other
1.52k stars 280 forks source link

Is it possible to compile the library without support for compression? #353

Closed JohnAlcatraz closed 1 year ago

JohnAlcatraz commented 1 year ago

The readme mentions this:

Before you build builds/vc/HDiffPatch.sln by Visual Studio, first get the libraries into sibling folders, like so:

$ git clone https://github.com/sisong/libmd5.git ../libmd5 $ git clone https://github.com/sisong/lzma.git ../lzma $ git clone https://github.com/sisong/zstd.git ../zstd $ git clone https://github.com/sisong/zlib.git ../zlib $ git clone https://github.com/sisong/bzip2.git ../bzip2

Is it possible to somehow to skip this, and instead compile the library without any support for compression? I don't need any compression in my project, so I would like to not have to include all those compression libraries.

sisong commented 1 year ago

yes,you can.

if you build project by make,you can try:
$ make MD5=0 LZMA=0 ZSTD=0 BZIP2=0 ZLIB=0 BSD=0

if you build project by vc, you need open builds/vc/HDiffPatch.sln, and remove sub projects(only need project hdiffz&hpatchz);
remove sub project libs link from project hdiffz&hpatchz;
remove set C/C++ define _ChecksumPlugin_md5; from project hdiffz&hpatchz;
remove md5.c from project hdiffz&hpatchz;

change code in hdiffz.cpp & hpatchz.c:
remove # define _ChecksumPlugin_crc32
change # define _IS_NEED_DEFAULT_ChecksumPlugin 1 to # define _IS_NEED_DEFAULT_ChecksumPlugin 0
change # define _IS_NEED_DEFAULT_CompressPlugin 1 to # define _IS_NEED_DEFAULT_CompressPlugin 0
change # define _IS_NEED_BSDIFF 1 to # define _IS_NEED_BSDIFF 0