-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[zlib, minizip] Update to 1.2.13, and embed the ZLIB_DLL setting. #27226
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
5d52e4e
Don't use external ZLIB_DLL
dg0yt 5884a5c
Update versions
dg0yt 92ed840
[minizip] Bump to zlib version
dg0yt f39126d
Update versions
dg0yt 2a1076f
[libkml] Fix mingw build
dg0yt 08f2128
[libkml] Modernize
dg0yt 40eedb6
[libkml] Fix minizip dependency
dg0yt ea0afa5
[libkml] No DLL
dg0yt 6f20678
Update versions
dg0yt d247830
[libkml] Update mingw patch
dg0yt fc3a058
Update versions
dg0yt 1522a6a
Merge remote-tracking branch 'origin/master' into zlib-dll
dg0yt 771e561
Update versions
dg0yt a872c9f
[zlib] Update to 1.2.13
BillyONeal 93e0378
Cherry pick installing the correct license from https://github.com/mi…
BillyONeal d22d5c7
Merge remote-tracking branch 'origin/master' into update-zlib
BillyONeal e6d5059
Merge remote-tracking branch 'dg0yt/zlib-dll' into update-zlib
BillyONeal 93275de
Update version database.
BillyONeal e425680
More version database.
BillyONeal ec159dc
Also update minizip.
BillyONeal f0e26a5
Also guard ZLIB_DLL properties for BUILD_SHARED_LIBS.
BillyONeal 1f55821
Version database.
BillyONeal 1e5f96d
Fix minizip usage.
BillyONeal 2af5853
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 028f50a..bb63ffb 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -26,6 +26,9 @@ set(LIBKML_DATA_DIR ${CMAKE_SOURCE_DIR}/testdata CACHE "Directory containing te | ||
if(CMAKE_COMPILER_IS_GNUCXX) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -pedantic -fno-rtti") | ||
set(TEST_FLAGS "-Wall -Wextra -Wno-unused-parameter -fno-rtti -DGTEST_HAS_RTTI=0") | ||
+if(WIN32) | ||
+ add_definitions(-DUNICODE -D_UNICODE) | ||
+endif() | ||
|
||
else() | ||
if(MSVC) | ||
diff --git a/src/kml/base/file_win32.cc b/src/kml/base/file_win32.cc | ||
index 28ccb36..6ba79cd 100644 | ||
--- a/src/kml/base/file_win32.cc | ||
+++ b/src/kml/base/file_win32.cc | ||
@@ -34,7 +34,9 @@ | ||
#include "kml/base/file.h" | ||
#include <windows.h> | ||
#include <tchar.h> | ||
+#ifndef __MINGW32__ | ||
#include <xstring> | ||
+#endif | ||
#include <algorithm> | ||
|
||
namespace kmlbase { | ||
diff --git a/src/kml/base/string_util.cc b/src/kml/base/string_util.cc | ||
index b3a9654..842f1cd 100644 | ||
--- a/src/kml/base/string_util.cc | ||
+++ b/src/kml/base/string_util.cc | ||
@@ -113,7 +113,7 @@ bool StringEndsWith(const string& str, const string& end) { | ||
} | ||
|
||
bool StringCaseEqual(const string& a, const string& b) { | ||
-#ifdef WIN32 | ||
+#if defined(WIN32) && !defined(__MINGW32__) | ||
# define strncasecmp(s1, s2, n) _strnicmp (s1, s2, n) | ||
#endif | ||
return a.size() == b.size() && strncasecmp(a.data(), b.data(), a.size()) == 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 9728ead..028f50a 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -110,9 +110,9 @@ else() | ||
list(APPEND MINIZIP_DEPENDS ZLIB) | ||
endif() | ||
|
||
-find_package(MiniZip) | ||
+find_package(MINIZIP NAMES minizip REQUIRED) | ||
if(MINIZIP_FOUND) | ||
- include_directories(${MINIZIP_INCLUDE_DIR}) | ||
+ set(MINIZIP_LIBRARY minizip::minizip) | ||
else() | ||
include(External_minizip) | ||
list(APPEND KMLBASE_DEPENDS MINIZIP) | ||
diff --git a/cmake/LibKMLConfig.cmake.in b/cmake/LibKMLConfig.cmake.in | ||
index 3e295f4..97826df 100644 | ||
--- a/cmake/LibKMLConfig.cmake.in | ||
+++ b/cmake/LibKMLConfig.cmake.in | ||
@@ -1,3 +1,6 @@ | ||
+include(CMakeFindDependencyMacro) | ||
+find_dependency(minizip CONFIG) | ||
+ | ||
# Compute paths | ||
get_filename_component(LIBKML_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||
|
||
diff --git a/src/kml/base/contrib/minizip/iomem_simple.c b/src/kml/base/contrib/minizip/iomem_simple.c | ||
index be89226..6be61d5 100644 | ||
--- a/src/kml/base/contrib/minizip/iomem_simple.c | ||
+++ b/src/kml/base/contrib/minizip/iomem_simple.c | ||
@@ -219,7 +219,7 @@ int ZCALLBACK mem_error (opaque, stream) | ||
return 0; | ||
} | ||
|
||
-ZEXTERN void* ZEXPORT mem_simple_create_file(zlib_filefunc_def* api, void* buffer, size_t buf_len) | ||
+extern void* mem_simple_create_file(zlib_filefunc_def* api, void* buffer, size_t buf_len) | ||
{ | ||
MEMFILE* handle = malloc(sizeof(*handle)); | ||
api->zopen_file = NULL; | ||
diff --git a/src/kml/base/contrib/minizip/iomem_simple.h b/src/kml/base/contrib/minizip/iomem_simple.h | ||
index ec11396..515e24e 100644 | ||
--- a/src/kml/base/contrib/minizip/iomem_simple.h | ||
+++ b/src/kml/base/contrib/minizip/iomem_simple.h | ||
@@ -70,7 +70,7 @@ void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); | ||
* This declaration is from the proposed iomem_simple package found at | ||
* http://code.trak.dk. See iomem_simple.c | ||
*/ | ||
-extern void* ZEXPORT mem_simple_create_file(zlib_filefunc_def* pzlib_filefunc_def, void* buffer, size_t buflen); | ||
+extern void* mem_simple_create_file(zlib_filefunc_def* pzlib_filefunc_def, void* buffer, size_t buflen); | ||
|
||
#ifdef __cplusplus | ||
} | ||
diff --git a/src/kml/base/contrib/minizip/unzip.c b/src/kml/base/contrib/minizip/unzip.c | ||
index a062863..fb69189 100644 | ||
--- a/src/kml/base/contrib/minizip/unzip.c | ||
+++ b/src/kml/base/contrib/minizip/unzip.c | ||
@@ -43,6 +43,14 @@ woven in by Terry Thorsen 1/2003. | ||
#include "unzip.h" | ||
#include "iomem_simple.h" | ||
#undef NOUNCRYPT | ||
+#ifdef ZEXPORT | ||
+# undef ZEXPORT | ||
+#endif | ||
+#define ZEXPORT | ||
+#ifdef ZEXTERN | ||
+# undef ZEXTERN | ||
+#endif | ||
+#define ZEXTERN extern | ||
|
||
#ifdef STDC | ||
# include <stddef.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
{ | ||
"name": "libkml", | ||
"version-string": "1.3.0", | ||
"port-version": 8, | ||
"version": "1.3.0", | ||
"port-version": 9, | ||
"description": "Reference implementation of OGC KML 2.2", | ||
"homepage": "https://github.com/libkml/libkml", | ||
"license": "BSD-3-Clause", | ||
"dependencies": [ | ||
"boost-smart-ptr", | ||
"expat", | ||
"minizip", | ||
"uriparser", | ||
{ | ||
"name": "minizip", | ||
"features": [ | ||
"bzip2" | ||
] | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
}, | ||
"uriparser", | ||
"zlib" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
minizip provides CMake targets: | ||
|
||
find_package(minizip CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE minizip::minizip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index b412dc7..f46c8e6 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -194,6 +194,7 @@ endif() | ||
# Example binaries | ||
#============================================================================ | ||
|
||
+if (0) | ||
add_executable(example test/example.c) | ||
target_link_libraries(example zlib) | ||
add_test(example example) | ||
@@ -211,3 +212,4 @@ if(HAVE_OFF64_T) | ||
target_link_libraries(minigzip64 zlib) | ||
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") | ||
endif() | ||
+endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index f46c8e6..6fa5575 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -121,9 +121,11 @@ set(ZLIB_SRCS | ||
) | ||
|
||
if(NOT MINGW) | ||
+ if(BUILD_SHARED_LIBS) | ||
set(ZLIB_DLL_SRCS | ||
win32/zlib1.rc # If present will override custom build rule below. | ||
) | ||
+ endif() | ||
endif() | ||
|
||
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION | ||
@@ -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() | ||
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() | ||
|
||
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 | ||
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) | ||
+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) | ||
if(NOT APPLE) | ||
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") | ||
endif() | ||
@@ -175,7 +180,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) | ||
endif() | ||
|
||
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) | ||
- install(TARGETS zlib zlibstatic | ||
+ install(TARGETS zlib | ||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" | ||
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" | ||
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this line need to be guarded with
if(BUILD_SHARED_LIBS)
as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit I didn't pay that close attention to what the patch was doing, this is just cmake-dont-build-more-than-needed.patch retargeted for this base commit. Will consider with the other PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, also guarded SOVERSION.