conan-center-index: [zlib] zlib/1.2.12: Compilation with Clang on Windows produces the wrong library name (z.lib instead of zlib.lib)

Description

To elaborate on the title:

  • When building zlib on Windows with MSVC, the produced library is named zlib.lib, as intended by all generators which try to locate a file with basename zlib.

  • If zlib is built with Conan 15 on Windows, the produced library is names z.lib instead, which breaks downstreams because they expect zlib basename.

Package and Environment Details

  • Package Name/Version: libpng/1.6.38
  • Operating System+version: Windows 10
  • Compiler+version: Clang 15 (scoop install llvm)
  • Conan version: conan 1.53.0

Conan profile

[settings] arch=x86_64 arch_build=x86_64 build_type=Debug compiler=clang compiler.cppstd=20 compiler.version=15 os=Windows os_build=Windows [options] [build_requires] *: cmake/3.24.1 [env] CONAN_CMAKE_GENERATOR=Unix Makefiles [conf] tools.cmake.cmaketoolchain:generator=Unix Makefiles

Steps to reproduce

Build zlib:

conan install -pr:h clang15-win-dev -pr:b build/Windows zlib/1.2.12@

Then locate the build package in the filesystem, and take a look under lib/ folder. It will contain z.lib for Clang builds, and zlib.lib for MSVC builds.

Logs

Click to expand log

It is more of filename issue than a log error per se.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18 (11 by maintainers)

Most upvoted comments

I’ve opened https://github.com/conan-io/conan/issues/12336. I believe that we can’t do anything robust currently without such method.

This approach of not supporting clang on Windows is quite disappointing. I’d much rather be told by my tool that something isn’t supported and error out rather than having random breakages in arbitrary packages. That aside I get that working with clang on Windows is a tad more annoying and tedious than MSVC but I don’t quite understand the criteria for not testing/supporting it. I don’t have numbers to back this up so if you like you can disregard this statement, but I wager that clang on Windows is used plenty enough to be a valuable inclusion to the conan teams thoughts and tests.

Edit: I should also not that the OP and I are not complaining about clang-cl not working on Windows but plain clang not working. The previous comment made it sound like we were complaining about clang-cl. Not that it matters much I reckon, but I still wanted to clarify.