Open Quuxplusone opened 10 years ago
Bugzilla Link | PR19403 |
Status | NEW |
Importance | P normal |
Reported by | Sumanth Gundapaneni (sgundapa@codeaurora.org) |
Reported on | 2014-04-11 13:54:53 -0700 |
Last modified on | 2020-03-02 02:11:49 -0800 |
Version | trunk |
Hardware | PC Windows NT |
CC | akhuang@google.com, dblaikie@gmail.com, ditaliano@apple.com, hans@chromium.org, llvm-bugs@lists.llvm.org, michael.holman@microsoft.com, rnk@google.com, zufuliu@163.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Try moving the 'check_library_exists(z compress2 "" HAVE_LIBZ)' call out of the NOT PURE_WINDOWS check. It might just work.
In chromium we're setting up zlib support for clang on windows here:
https://bugs.chromium.org/p/chromium/issues/detail?id=1004965
(In reply to Reid Kleckner from comment #2)
> In chromium we're setting up zlib support for clang on windows here:
> https://bugs.chromium.org/p/chromium/issues/detail?id=1004965
I see. My change was going to be to search for zlib with cmake's FindZlib
module. Then the user just has to set ZLIB_ROOT or
ZLIB_INCLUDE_DIRS/ZLIB_LIBRARIES instead of modifying compiler and linker flags
(which is what it looks like you are doing).
It seems like my change is still a simplification, but let me know if you think
it's unnecessary.
By all means, go for it. Using CMake's FindZLib will probably simplify our efforts to make it work in Chromium.
After https://reviews.llvm.org/D74176
the project no longer build with cmake 3.16.4:
CMake Error at lib/Support/CMakeLists.txt:202 (STRING):
STRING sub-command REGEX, mode REPLACE: regex "^" matched an empty string.
line 202-203:
STRING(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" zlib_library ${zlib_library})
STRING(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" zlib_library ${zlib_library})
(In reply to Zufu Liu from comment #5)
> After https://reviews.llvm.org/D74176
> the project no longer build with cmake 3.16.4:
> CMake Error at lib/Support/CMakeLists.txt:202 (STRING):
> STRING sub-command REGEX, mode REPLACE: regex "^" matched an empty string.
>
> line 202-203:
> STRING(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" zlib_library
> ${zlib_library})
> STRING(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" zlib_library
> ${zlib_library})
I believe rnk fixed this in 1079c68aa0fdb14d270a31c0df49a2afc5ed2485