mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
[libarchive] expose zstd as a build feature (#11044)
* [libarchive] add zlib and zstd to wrapper and expose zstd as a build feature. * bump control
This commit is contained in:
parent
657becf609
commit
f05560d812
@ -1,15 +1,19 @@
|
||||
Source: libarchive
|
||||
Version: 3.4.1-1
|
||||
Version: 3.4.1-2
|
||||
Homepage: https://github.com/libarchive/libarchive
|
||||
Description: Library for reading and writing streaming archives
|
||||
Build-Depends: zlib
|
||||
Default-Features: bzip2, libxml2, lz4, lzma, lzo, openssl
|
||||
Default-Features: bzip2, libxml2, lz4, lzma, lzo, openssl, zstd
|
||||
Supports: !uwp
|
||||
|
||||
Feature: bzip2
|
||||
Build-Depends: bzip2
|
||||
Description: BZip2 support
|
||||
|
||||
Feature: zstd
|
||||
Build-Depends: zstd
|
||||
Description: zstd support
|
||||
|
||||
Feature: libxml2
|
||||
Build-Depends: libxml2
|
||||
Description: Libxml2 support
|
||||
|
@ -21,18 +21,20 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
lzma ENABLE_LZMA
|
||||
lzo ENABLE_LZO
|
||||
openssl ENABLE_OPENSSL
|
||||
zstd ENABLE_ZSTD
|
||||
# The below features should be added to CONTROL
|
||||
#pcre ENABLE_PCREPOSIX
|
||||
#nettle ENABLE_NETTLE
|
||||
#expat ENABLE_EXPAT
|
||||
#libgcc ENABLE_LibGCC
|
||||
#cng ENABLE_CNG
|
||||
#tar ENABLE_TAR
|
||||
#cpio ENABLE_CPIO
|
||||
#cat ENABLE_CAT
|
||||
#xattr ENABLE_XATTR
|
||||
#acl ENABLE_ACL
|
||||
#iconv ENABLE_ICONV
|
||||
#tar ENABLE_TAR # Tool build option?
|
||||
#cpio ENABLE_CPIO # Tool build option?
|
||||
#cat ENABLE_CAT # Tool build option?
|
||||
#xattr ENABLE_XATTR # Tool support option?
|
||||
#acl ENABLE_ACL # Tool support option?
|
||||
#iconv ENABLE_ICONV # iconv support option?
|
||||
#libb2 ENABLE_LIBB2
|
||||
)
|
||||
|
||||
if(FEATURES MATCHES "pcre")
|
||||
@ -40,6 +42,8 @@ else()
|
||||
list(APPEND FEATURE_OPTIONS -DPOSIX_REGEX_LIB=NONE)
|
||||
endif()
|
||||
|
||||
list(APPEND FEATURE_OPTIONS -DENABLE_ZLIB=ON)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
|
@ -1,6 +1,10 @@
|
||||
_find_package(${ARGS})
|
||||
|
||||
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
||||
if(@ENABLE_ZLIB@)
|
||||
find_package(ZLIB REQUIRED)
|
||||
list(APPEND LibArchive_LIBRARIES ZLIB::ZLIB)
|
||||
endif()
|
||||
if(@ENABLE_BZip2@)
|
||||
find_package(BZip2 REQUIRED)
|
||||
list(APPEND LibArchive_LIBRARIES BZip2::BZip2)
|
||||
@ -27,6 +31,16 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
||||
list(APPEND LibArchive_LIBRARIES debug ${LZO_LIBRARY_DEBUG})
|
||||
endif()
|
||||
endif()
|
||||
if(@ENABLE_ZSTD@)
|
||||
find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd zstd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH)
|
||||
find_library(ZSTD_LIBRARY_RELEASE NAMES zstd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
|
||||
if(ZSTD_LIBRARY_RELEASE)
|
||||
list(APPEND LibArchive_LIBRARIES optimized ${ZSTD_LIBRARY_RELEASE})
|
||||
endif()
|
||||
if(ZSTD_LIBRARY_DEBUG)
|
||||
list(APPEND LibArchive_LIBRARIES debug ${ZSTD_LIBRARY_DEBUG})
|
||||
endif()
|
||||
endif()
|
||||
if(@ENABLE_OPENSSL@)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
list(APPEND LibArchive_LIBRARIES OpenSSL::Crypto)
|
||||
@ -36,6 +50,9 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
||||
if(@ENABLE_BZip2@)
|
||||
target_link_libraries(LibArchive::LibArchive INTERFACE BZip2::BZip2)
|
||||
endif()
|
||||
if(@ENABLE_ZLIB@)
|
||||
target_link_libraries(LibArchive::LibArchive INTERFACE ZLIB::ZLIB)
|
||||
endif()
|
||||
if(@ENABLE_LIBXML2@)
|
||||
target_link_libraries(LibArchive::LibArchive INTERFACE LibXml2::LibXml2)
|
||||
endif()
|
||||
@ -54,6 +71,15 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
||||
endif()
|
||||
set_property(TARGET LibArchive::LibArchive APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${interface_lib})
|
||||
endif()
|
||||
if(@ENABLE_ZSTD@)
|
||||
if(ZSTD_LIBRARY_RELEASE)
|
||||
list(APPEND interface_lib \$<\$<NOT:\$<CONFIG:DEBUG>>:${ZSTD_LIBRARY_RELEASE}>)
|
||||
endif()
|
||||
if(ZSTD_LIBRARY_DEBUG)
|
||||
list(APPEND interface_lib \$<\$<CONFIG:DEBUG>:${ZSTD_LIBRARY_DEBUG}>)
|
||||
endif()
|
||||
set_property(TARGET LibArchive::LibArchive APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${interface_lib})
|
||||
endif()
|
||||
if(@ENABLE_OPENSSL@)
|
||||
target_link_libraries(LibArchive::LibArchive INTERFACE OpenSSL::Crypto)
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user