Mika Lindqvist [Tue, 23 Jan 2024 05:42:29 +0000 (07:42 +0200)]
Generate CMake package configuration files
* For COMPAT mode, zlib-config.cmake and zlib-config-version.cmake
* For non-COMPAT mode, zlib-ng-config.cmake and zlib-ng-config-version.cmake
Mika Lindqvist [Wed, 24 Jan 2024 20:48:00 +0000 (22:48 +0200)]
Fix regression caused by 2fa631e029084b75acd81db5d33fd4aa802fd082
* POWER8/9 feature checks were enabled even if the toolchain didn't support AT_HWCAP2
* Add detection if we need to include <linux/auxvec.h>
Letu Ren [Sun, 17 Dec 2023 16:58:38 +0000 (00:58 +0800)]
Only read version information from zlib.h.in
This is a patch for https://github.com/zlib-ng/zlib-ng/commit/cd458c79c7923e76ffdd0e2638bf2a0eed4f3996
As the commit message says: "Add code to extract version information
for both ZLIB and ZLIBNG variants from the zlib.h file."
The logic of ${SUFFIX} is that zlib-ng reads version information after
parse ZLIB_COMPAT before the commit mentioned above. ${SUFFIX} will only
be set by ZLIB_COMPAT and is meaningless before ZLIB_COMPAT.
Letu Ren [Thu, 14 Dec 2023 07:27:08 +0000 (15:27 +0800)]
Remove duplicate enable tests option
There are two identical ZLIB_ENABLE_TESTS option in CMakeLists.txt which
means the latter one is meaningless. This issue is introduced in
https://github.com/zlib-ng/zlib-ng/commit/ce1a64b5147b874a2dd32920765be333f54e7095
which adds the option to top but forgets to remove the original one.
Adam Stylinski [Tue, 7 Nov 2023 20:22:55 +0000 (15:22 -0500)]
Detemplatize adler32_fold_copy for avx512
Measurements show deltas basically in the noise floor for the
benchmarks.
The AVX512 VNNI implementation is a bit special in that it seems to be
be hurt by the clock penalty enough versus a normal copy that a 256 bit
wide variant was warranted.
Adam Stylinski [Fri, 17 Nov 2023 23:26:45 +0000 (18:26 -0500)]
Fix an issue with regard to finishing out the window
if inflate is invoked with Z_FINISH, and it deems a window was not
necessary, there's a corner case where we never checksum the bytes.
Detect this by checking the window size against zero and the value
of the flush parameter.
This should fix issue #1600, and possibly #1565 as well.
Added unit test for inflate with Z_FINISH and no window.
This test decompresses a small git pack object with the text:
"alone in the dark". By providing inflate with Z_FINISH, it should not use a
sliding window according to zlib docs. We purposefully limit the read buffer
size to trigger CHECK mode to bail early.
Hajin Jang [Mon, 25 Sep 2023 17:15:10 +0000 (02:15 +0900)]
Detect -Wno-pedantic-ms-format support in mingw
Use check_c_compiler_flag() feature of CMake to figure out whether this
mingw toolchain has support for -Wno-pedantic-ms-format or not.
This flag will be added only if the toolchain supports it.
Currently, MinGW-w64 GCC has it, and llvm-mingw does not have it.
Hajin Jang [Sun, 10 Sep 2023 09:28:28 +0000 (18:28 +0900)]
Support llvm-mingw toolchain
zlib-ng requires some patches to make it compilable on LLVM-mingw.
1. Add -Wno-pedantic-ms-format only if a toolchain is MinGW GCC.
- llvm-mingw does not support it, causing build to break.
2. Include arm_neon.h instead of arm64_neon.h (aarch64 only).
- arm64_neon.h is MSVC only.
- GCC, Clang does not have arm64_neon.h but arm_neon.h on aarch64.
- Also applied to configure and detect-instrinsics.cmake
Don't run test intrinsic code with native flag in CMake.
Native flag should already determine what code will run on the architecture.
This appears to have just been an extra run check with limited benefits. Any
compiler that compiles code not available on the native platform is buggy and
not our problem.
Deniz Bahadir [Fri, 15 Sep 2023 16:23:27 +0000 (18:23 +0200)]
Match CMAKE_GENERATOR_TOOLSET variable case-insensitive
The Visual Studio CMake generator allows to select different toolsets.
One of these toolsets is Clang-Cl.
However, the generator does accept the toolset name case-agnostic, so it
could be "ClangCl", but also "Clangcl" or "clangcl" or ...
This value will be stored verbatim in variable CMAKE_GENERATOR_TOOLSET
by CMake. Therefore, this variable must be matched case-insensitive,
which is what this commit does.
fixes: #1576
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
Deniz Bahadir [Fri, 15 Sep 2023 13:46:56 +0000 (15:46 +0200)]
Fix examining value of GENERATOR_IS_MULTI_CONFIG
CMake does not define a variable GENERATOR_IS_MULTI_CONFIG by default.
Instead it sets a global property of that name.
In order to examine its value it first has to be retrieved and stored
into a (local) variable, which is what this commit does.
fixes: #1574
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>