summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
2021-12-24Make integration into bigger projects easierDženan Zukić
2021-12-24Added build system check for posix_memalign support.Nathan Moinvaziri
Co-authored-by: concatime <concatime@users.noreply@github.com> Co-authored-by: Mika Lindqvist <postmaster@raasu.org>
2021-12-24[arm] Disable ACLE, UNALIGNED_OK and UNALIGNED64_OK on armv7 and earlier.Mika Lindqvist
* armv7 has partial support for unaligned reads, but compiler might use instructions that do not support unaligned accesses
2021-12-24Added unit test to ensure that inflate with adler32 hash works on previously ↵Nathan Moinvaziri
failed test case.
2021-12-24Add new crc32 unit testMatheus Castanho
2021-06-21Change WITH_SANITIZER to be a multi-option parameter (for ccmake etc).Hans Kristian Rosbach
Add support for selcting Thread sanitizer.
2021-06-11fix: SSE42CMPSTR compiled even if WITH_SSE4=OFFIlya Kurdyukov
2021-05-29Only when using Visual C++, the static library name should be "zlibstatic"Mika Lindqvist
* On CygWin, MSYS and MinGW, the static library name should be "z" like on other Unix-like systems
2021-05-29Remove unnecessary test for stdarg.hMika Lindqvist
2021-05-29Handle HAVE_UNISTD_H defined to 0.Paweł Wegner
FFmpeg during the configure stage generates a config.h file with ``` #define HAVE_UNISTD_H 0 ``` on windows. Then somewhere in FFmpeg's code there is: ``` #include "config.h" // FFmpeg's config.h #include <zlib.h> ``` which causes zlib.h to include unistd.h on windows. It is way easier to handle the issue here than in FFmpeg. Co-authored-by: Mika Lindqvist <postmaster@raasu.org>
2021-05-27Fix build under Cygwin.Mika Lindqvist
2021-05-18Remove redundancy; apple is unixGreg Sjaardema
2021-05-18Fix compiler detection to avoid bad mpicc matchGreg Sjaardema
2021-05-16Spelling fixesGreg Sjaardema
2021-05-09[ARM/AArch64] More thorough testing of getauxval() macros and includesMika Lindqvist
* 32-bit ARM and AArch64 use slightly different macros for CRC32 and NEON feature bits * 32-bit ARM sometimes requires asm/hwcap.h for AT_HWCAP2
2021-04-29Detect hwcap flags needed for runtime detection on ARM LinuxJosh Triplett
This allows us to provide useful warning messages from cmake or configure if the system headers don't provide the necessary flags to do runtime detection.
2021-04-27Fix build with LTO on GCCVictor Westerhuis
2021-04-14Write generated files during tests to CMake's build directory using the name ↵Nathan Moinvaziri
of the test. Co-authored-by: Vladislav Shchapov <phprus@users.noreply.github.com>
2021-04-09Changed auto-detection of float-abi support by removing triplet check in ↵Nathan Moinvaziri
favor of compilation and link test. #911
2021-03-22Detect unsupported VS at configure time (and not at compile time)tbeu
2021-03-20Only perform auto-detection of floating point ABI on ARM arch. #895Nathan Moinvaziri
Co-authored-by: zhangn1985 <zhangn1985@users.noreply.github.com>
2021-03-20Restore hash_head != 0 checksIlya Leoshkevich
Commit bc5915e2dec7 ("Fixed unsigned integer overflow ASAN error when hash_head > s->strstart.") removed hash_head != 0 checks in fast, medium and slow deflate, because it improved performance [1]. Unfortunately, the attached test started failing after that. Apparently, as the comments suggest, the code implicitly relies on matches with the beginning of the window being skipped. So restore the check. [1] https://github.com/zlib-ng/zlib-ng/pull/772#issuecomment-710760300
2021-03-18Add a CMake macro for simple test executablesIlya Leoshkevich
6 tests use the same pattern: build a binary linked with zlib-ng and run it. At the moment this requires 5 near-identical lines of CMake code, leading to proliferation of copy-paste. Introduce a macro to get rid of it.
2021-03-18Cmake: Accept custom install dirs in various formats from command line.Hans Kristian Rosbach
2021-03-17Remove unused header checks from CMake. These are legacy checks that zlib ↵Nathan Moinvaziri
used to use.
2021-03-17Fix .pc file generation in CMakeLists.txtVictor Westerhuis
Two words were swapped in a variable name, leading to empty libdir and includedir variables in the generated .pc files.
2021-03-17Fix block_open handling in deflate_quick()Ilya Leoshkevich
The attached test fails with "inflate() failed", because the deflate stream that it produces ends up being corrupted. Bisect points to the commit e7bb6db09a18 ("Replace hash_bits, hash_size and hash_mask with defines."), but it's most likely a coincidence. In any case, the reason is that if we happen to simultaneously exhaust all the buffers (in, out and bi), we return finish_started without writing the end of block symbol, which will never happen afterwards. Fix by adding another check to the tricky condition: if we are in the middle of a block, return need_more instead of finish_started.
2021-03-16Fix defining HAVE_SYS_SDT_H with CMakeIlya Leoshkevich iii@linux.ibm.com
DFLTCC probe points are never activated when compiling with CMake. This is because check_include_file() only sets an internal CMake variable, but not a C define [1]. Fix as the link suggests - by adding an explicit add_definitions. [1] https://cmake.org/pipermail/cmake/2015-June/060830.html
2021-03-16Add testing of minigzip/minideflate --help and invalid parameterHans Kristian Rosbach
2021-03-16Fix bi_valid handling in deflate_quick()Ilya Leoshkevich iii@linux.ibm.com
The attached test started failing after commit ad89d5131b29 ("Don't write end of last block when returning finish_started."): either with "bi_buf not flushed" message in debug builds, or by producing corrupted output in release builds. The problem is that we must not return finish_started when bi_buf is not empty, because the bits there will be lost. Fix by checking that bi_valid is not 0.
2021-03-16Quote CMAKE_C_FLAGS_RELEASEIlya Leoshkevich iii@linux.ibm.com
2021-03-15[CMake] Add zlibstatic alias when BUILD_SHARED_LIBS is "OFF"past-due
2021-03-09Remove misleading manpage.Hans Kristian Rosbach
README.md changes: - Added a related projects section at the end. - Added blank line after header where missing. - Added extra blank line before header to make them easier to spot as plain-text. - Changed line-length for Contributing section, to make it more readable as plain-text.
2021-02-25Add porting guide.Hans Kristian Rosbach
Sync cmake dfltcc descriptions with README.
2021-02-17Use cmake check_c_compiler_flag for -fno-semantic-interposition compiler ↵Nathan Moinvaziri
flag check.
2021-02-17Move code coverage detection into its own cmake file.Nathan Moinvaziri
2021-02-17Improve compiler detection of code coverage flags.Nathan Moinvaziri
Pass -coverage or flag to linker for mingw-gcc.
2021-01-16Sync cmake variable names with names already used by %cmake macros inHans Kristian Rosbach
rpm-specs on redhat-based distros, making it easier to build corect packages.
2021-01-12Fix SONAME versionHans Kristian Rosbach
2021-01-11Disallow semantic interposition in ELF shared libraries if supported by the ↵Hans Kristian Rosbach
compiler. This disallows calls to our own exported functions being replaced by LD_PRELOAD, thus avoiding the potential bugs and allowing the compiler to optimize better.
2020-12-12Separate sanitizers so they can be run independently.Nathan Moinvaziri
2020-11-22Separate crc32 and crc32_combine tables so the crc32_combine tables are not ↵Nathan Moinvaziri
included when not used if statically linking. Reduces code size by 4k.
2020-11-21CMake: fix 'ALDER32' typo in feature info messageGreg V
2020-10-24Combine option and add_feature_info in CMake.Nathan Moinvaziri
2020-10-18Fixed formatting in check_c_source_compiles checks for consistency.Nathan Moinvaziri
2020-10-18Fixed ptrdiff_t redefined static analysis warning on GCC. Failing ptrdiff_t ↵Nathan Moinvaziri
detection due to variable unused warning combined with -Werror. In file included from zlib-ng/zlib-ng.h:33, from zlib-ng/zutil.h:38, from zlib-ng/adler32.c:7: zlib-ng/zconf-ng.h:118:18: error: conflicting types for ‘ptrdiff_t’ 118 | typedef uint64_t ptrdiff_t; | ^~~~~~~~~ In file included from zlib-ng/zutil.h:31, from zlib-ng/adler32.c:7: stddef.h:143:26: note: previous declaration of ‘ptrdiff_t’ was here 143 | typedef __PTRDIFF_TYPE__ ptrdiff_t; | ^~~~~~~~~
2020-09-23Added option to normalize line-endings in CMake run-and-compare script.Nathan Moinvaziri
2020-09-23Move tests closer to add_executable in CMake to make them easier to find.Nathan Moinvaziri
2020-09-23Ignore hidden test files with ctest on macOS.Nathan Moinvaziri
2020-09-23Turn off compare and gzip verify in GH-536 tests due to switchlevels.Nathan Moinvaziri