[zlib] Ignore external ZLIB_DLL
-
What does your PR fix?
Hardcodes the triplet linkage into the installed headers, so that usage no longer depends on external definition of
ZLIB_DLL. For example, GDAL always appliesZLIB_DLL. Noticed in log from https://github.com/microsoft/vcpkg/pull/26676#issuecomment-1251764155:LINK : warning LNK4286: symbol 'crc32' defined in 'zlib.lib(crc32.obj)' is imported by 'gdal.lib(cpl_minizip_unzip.cpp.obj)' LINK : warning LNK4217: symbol 'deflateInit_' defined in 'zlib.lib(deflate.obj)' is imported by 'gdal.lib(cpl_vsil_gzip.cpp.obj)' in function 'CPLZLibDeflate'Given the broad impact of port zlib changes, this PR should be considered for combination with other zlib changes: #26792
-
Which triplets are supported/not supported? Have you updated the CI baseline?
unchanged, no
-
Does your PR follow the maintainer guide?
yes
-
If you have added/updated a port: Have you run
./vcpkg x-add-version --alland committed the result?yes
Why has this not been a problem before?
Why has this not been a problem before?
a) Packages tend to unconditionally set ZLIB_DLL.
Evidence: gdal as mentioned aboved; git grep ZLIB_DLL
b) There is only a warning in static builds, not an error.
c) Contributors and reviewers don't care for this warning. In particular when connected with other errors
Evidence: the mentioned gdal issue; https://github.com/microsoft/vcpkg/search?q=LNK4217&type=issues
libkml probably stumbles over a mix of headers from zlib and its vendored copy of minizip.
I want to improve the libkml mingw patch.
Please do the cherry-pick.
Thanks again!