From f0e26a52aa64f0e92393441348d1e7e8e4ff99cc Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 19 Oct 2022 13:47:27 -0700 Subject: [PATCH] Also guard ZLIB_DLL properties for BUILD_SHARED_LIBS. --- .../0003-build-static-or-shared-not-both.patch | 14 +++++++++----- ports/zlib/0004-android-and-mingw-fixes.patch | 9 ++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ports/zlib/0003-build-static-or-shared-not-both.patch b/ports/zlib/0003-build-static-or-shared-not-both.patch index b38e4213e254c9..c9f2ecf19762e8 100644 --- a/ports/zlib/0003-build-static-or-shared-not-both.patch +++ b/ports/zlib/0003-build-static-or-shared-not-both.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f46c8e6..29508ae 100644 +index f46c8e6..6fa5575 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,9 +121,11 @@ set(ZLIB_SRCS @@ -14,22 +14,26 @@ index f46c8e6..29508ae 100644 endif() # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION -@@ -144,11 +146,12 @@ if(MINGW) +@@ -144,13 +146,16 @@ if(MINGW) -I ${CMAKE_CURRENT_BINARY_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + if(BUILD_SHARED_LIBS) set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) - endif(MINGW) + endif() + endif(MINGW) -add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++if (BUILD_SHARED_LIBS) set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) set_target_properties(zlib PROPERTIES SOVERSION 1) ++endif() -@@ -165,7 +168,7 @@ endif() + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version +@@ -165,7 +170,7 @@ endif() if(UNIX) # On unix-like platforms the library is almost always called libz @@ -38,7 +42,7 @@ index f46c8e6..29508ae 100644 if(NOT APPLE) set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") endif() -@@ -175,7 +178,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) +@@ -175,7 +180,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) endif() if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) diff --git a/ports/zlib/0004-android-and-mingw-fixes.patch b/ports/zlib/0004-android-and-mingw-fixes.patch index 9acc9a5f8dfc20..e93173f24618b8 100644 --- a/ports/zlib/0004-android-and-mingw-fixes.patch +++ b/ports/zlib/0004-android-and-mingw-fixes.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 29508ae..4223676 100644 +index 6fa5575..7c345db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ endif() @@ -20,13 +20,12 @@ index 29508ae..4223676 100644 # This gets us DLL resource information when compiling on MinGW. if(NOT CMAKE_RC_COMPILER) set(CMAKE_RC_COMPILER windres.exe) -@@ -148,8 +148,8 @@ if(MINGW) - -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) +@@ -149,7 +149,7 @@ if(MINGW) if(BUILD_SHARED_LIBS) set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) --endif(MINGW) endif() +-endif(MINGW) +endif(MINGW AND NOT ANDROID) add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + if (BUILD_SHARED_LIBS)