vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[zlib] Ignore external ZLIB_DLL

Open dg0yt opened this issue 3 years ago • 3 comments

  • 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 applies ZLIB_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 --all and committed the result?

    yes

dg0yt avatar Sep 20 '22 05:09 dg0yt

Why has this not been a problem before?

Neumann-A avatar Sep 20 '22 12:09 Neumann-A

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

dg0yt avatar Sep 21 '22 04:09 dg0yt

libkml probably stumbles over a mix of headers from zlib and its vendored copy of minizip.

dg0yt avatar Sep 21 '22 04:09 dg0yt

I want to improve the libkml mingw patch.

dg0yt avatar Sep 23 '22 17:09 dg0yt

Please do the cherry-pick.

dg0yt avatar Oct 19 '22 03:10 dg0yt

Thanks again!

BillyONeal avatar Oct 25 '22 17:10 BillyONeal