Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build files: consistency of binaries names on Windows between CMakeLists and Makefiles #652

Open
SpaceIm opened this issue May 13, 2022 · 6 comments · May be fixed by #1027
Open

Build files: consistency of binaries names on Windows between CMakeLists and Makefiles #652

SpaceIm opened this issue May 13, 2022 · 6 comments · May be fixed by #1027

Comments

@SpaceIm
Copy link

SpaceIm commented May 13, 2022

For Windows builds, zlib provides 4 build files:

  • Makefile.gcc for MinGW
  • Makefile.msvc and MSBuild files for Visual Studio
  • CMake

For a given compiler, names of generated binaries are not consistent among these build systems:

MinGW:

build file static shared (import lib & dll)
Makefile.gcc libz.a libz.dll.a & zlib1.dll
CMakeLists.txt libzlibstatic.a libzlib.dll.a & libzlib1.dll

Visual Studio:

build file static shared (import lib & dll)
Makefile.msvc zlib.lib zdll.lib & zlib1.dll
MSBuild zlibstat.lib zlibwapi.lib & zlibwapi.dll
CMakeLists.txt zlibstatic[d].lib zlib[d].lib & zlib[d]1.dll

Wouldn't it be better to follow Makefiles names in CMakeLists.txt? What is considered canonical name for each compiler?

@jheaff1
Copy link

jheaff1 commented Aug 7, 2022

Further to what is described above, when building static zlib using CMake on Windows, the output lib (zlibstatic.lib) does not match what is described in the pkg-config .pc file. As such, if a dependent library were to use pkg-config to resolve a statically built zlib on Windows, it would fail

@madler
Copy link
Owner

madler commented Aug 7, 2022

Do you or anyone else here have an opinion on what those names should be?

@jheaff1
Copy link

jheaff1 commented Aug 8, 2022

I’m personally not bothered about naming inconsistencies, as long as usage of the pkg-config .pc file works

@vszakats
Copy link

vszakats commented Oct 14, 2022

With MinGW (and MSYS/Cygwin) the expected names are: libz.a for static and libz.dll.a for the implib. These are recognized by the toolchain as static/shared libs when linking.

@Neustradamus
Copy link

To follow this ticket

@AraHaan
Copy link
Contributor

AraHaan commented Oct 26, 2022

Also: building in WSL (ubuntu 22.10 on it) fails to run ./configure as well.

Likewise, I have a situation where I would like to build zlib for linux-x86, linux-x64, linux-arm, and linux-arm64 (all in a x64 build of linux).

kdesysadmin pushed a commit to KDE/krita that referenced this issue Feb 2, 2023
See upstream bug:
madler/zlib#652

Without this workaround packagies using zlib via pkg-config won't link
(that is, raqm and harfbuzz)
@Vollstrecker Vollstrecker linked a pull request Dec 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants