mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 11:49:05 +08:00
[libzip] Fix zstd feature (#30500)
* [libzip] Use the upstream package name for zstd. Without it, when with the zstd feature, calling `find_package` on libzip would fail due to the `Zstd` not being found. * [libzip] Bump port version. * [libzip] Update baseline. * [libzip] Reduce patch size by using NAMES. * [libzip] Update version.
This commit is contained in:
parent
23f0707b1a
commit
47fb7ebacd
@ -1,5 +1,40 @@
|
|||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index d00a4f9f..cf85fc4b 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -197,7 +197,7 @@ if(ENABLE_LZMA)
|
||||||
|
endif(ENABLE_LZMA)
|
||||||
|
|
||||||
|
if(ENABLE_ZSTD)
|
||||||
|
- find_package(Zstd 1.3.6)
|
||||||
|
+ find_package(Zstd NAMES zstd 1.3.6)
|
||||||
|
if(Zstd_FOUND)
|
||||||
|
set(HAVE_LIBZSTD 1)
|
||||||
|
else()
|
||||||
|
@@ -301,7 +301,7 @@ foreach(LIB ${LIBS_PRIVATE})
|
||||||
|
endforeach()
|
||||||
|
string(REGEX REPLACE "-lBZip2::BZip2" "-lbz2" LIBS ${LIBS})
|
||||||
|
string(REGEX REPLACE "-lLibLZMA::LibLZMA" "-llzma" LIBS ${LIBS})
|
||||||
|
-string(REGEX REPLACE "-lZstd::Zstd" "-lzstd" LIBS ${LIBS})
|
||||||
|
+string(REGEX REPLACE "-l$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>" "-lzstd" LIBS ${LIBS})
|
||||||
|
string(REGEX REPLACE "-lOpenSSL::Crypto" "-lssl -lcrypto" LIBS ${LIBS})
|
||||||
|
string(REGEX REPLACE "-lZLIB::ZLIB" "-lz" LIBS ${LIBS})
|
||||||
|
string(REGEX REPLACE "-lGnuTLS::GnuTLS" "-lgnutls" LIBS ${LIBS})
|
||||||
|
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
||||||
|
index 1213fa0a..b6446cbd 100644
|
||||||
|
--- a/lib/CMakeLists.txt
|
||||||
|
+++ b/lib/CMakeLists.txt
|
||||||
|
@@ -147,7 +147,7 @@ endif()
|
||||||
|
|
||||||
|
if(HAVE_LIBZSTD)
|
||||||
|
target_sources(zip PRIVATE zip_algorithm_zstd.c)
|
||||||
|
- target_link_libraries(zip PRIVATE Zstd::Zstd)
|
||||||
|
+ target_link_libraries(zip PRIVATE $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_COMMONCRYPTO)
|
||||||
diff --git a/libzip-config.cmake.in b/libzip-config.cmake.in
|
diff --git a/libzip-config.cmake.in b/libzip-config.cmake.in
|
||||||
index 5b9aa55..0723f3c 100644
|
index 5b9aa558..f9adc538 100644
|
||||||
--- a/libzip-config.cmake.in
|
--- a/libzip-config.cmake.in
|
||||||
+++ b/libzip-config.cmake.in
|
+++ b/libzip-config.cmake.in
|
||||||
@@ -1,8 +1,20 @@
|
@@ -1,8 +1,20 @@
|
||||||
@ -16,7 +51,7 @@ index 5b9aa55..0723f3c 100644
|
|||||||
+ find_dependency(LibLZMA)
|
+ find_dependency(LibLZMA)
|
||||||
+endif()
|
+endif()
|
||||||
+if(@ENABLE_ZSTD@)
|
+if(@ENABLE_ZSTD@)
|
||||||
+ find_dependency(Zstd)
|
+ find_dependency(zstd)
|
||||||
+endif()
|
+endif()
|
||||||
+if(@ENABLE_OPENSSL@)
|
+if(@ENABLE_OPENSSL@)
|
||||||
+ find_dependency(OpenSSL)
|
+ find_dependency(OpenSSL)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "libzip",
|
"name": "libzip",
|
||||||
"version": "1.9.2",
|
"version": "1.9.2",
|
||||||
|
"port-version": 1,
|
||||||
"description": "A library for reading, creating, and modifying zip archives.",
|
"description": "A library for reading, creating, and modifying zip archives.",
|
||||||
"homepage": "https://github.com/nih-at/libzip",
|
"homepage": "https://github.com/nih-at/libzip",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
|
@ -4770,7 +4770,7 @@
|
|||||||
},
|
},
|
||||||
"libzip": {
|
"libzip": {
|
||||||
"baseline": "1.9.2",
|
"baseline": "1.9.2",
|
||||||
"port-version": 0
|
"port-version": 1
|
||||||
},
|
},
|
||||||
"libzippp": {
|
"libzippp": {
|
||||||
"baseline": "6.0-1.9.2",
|
"baseline": "6.0-1.9.2",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "42ad3093c3b335f0ae0bf54179faa30bd751d00c",
|
||||||
|
"version": "1.9.2",
|
||||||
|
"port-version": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "ec8e48c035f43c65ce9f0f5b455affaa92aa477e",
|
"git-tree": "ec8e48c035f43c65ce9f0f5b455affaa92aa477e",
|
||||||
"version": "1.9.2",
|
"version": "1.9.2",
|
||||||
|
Loading…
Reference in New Issue
Block a user