zlib patch to use std name for lib.

Use a standard name libz.(so|a) if we are using mingw (as we do on linux).

This patch somehow deprecate the previous commit (patch) but both patches
are the right thing to do.
We need this one especially for others dependencies using pkg-config.
The generated .pc always use the '-lz' option and so, we need the correct
names for the lib.
This commit is contained in:
Matthieu Gautier 2017-02-07 12:06:41 +01:00
parent 5259568a89
commit 640750e1ab
2 changed files with 16 additions and 0 deletions

View File

@ -752,6 +752,7 @@ class zlib(Dependency):
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('zlib-1.2.8.tar.gz', archive = Remotefile('zlib-1.2.8.tar.gz',
'36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d') '36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d')
patches = ['zlib_std_libname.patch']
class Builder(CMakeBuilder): class Builder(CMakeBuilder):
@property @property

View File

@ -0,0 +1,15 @@
diff -ur zlib-1.2.8/CMakeLists.txt zlib-1.2.8.std_libname/CMakeLists.txt
--- zlib-1.2.8/CMakeLists.txt 2013-04-29 00:57:10.000000000 +0200
+++ zlib-1.2.8.std_libname/CMakeLists.txt 2017-02-07 11:56:21.826507000 +0100
@@ -205,6 +205,9 @@
if(NOT APPLE)
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
+elseif(MINGW)
+ # On unix-like platforms the library is almost always called libz
+ set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
elseif(BUILD_SHARED_LIBS AND WIN32)
# Creates zlib1.dll when building shared library version
set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
Only in zlib-1.2.8: zconf.h
Only in zlib-1.2.8.std_libname: zconf.h.included