[librdkafka] Add features

This commit is contained in:
myd7349 2019-04-03 18:50:39 +08:00
parent af8fa46a03
commit 7c73e98b9f
2 changed files with 47 additions and 1 deletions

View File

@ -1,4 +1,20 @@
Source: rdkafka
Version: v1.0.0
Description: The Apache Kafka C/C++ library
Build-Depends: openssl, zlib, zstd
Default-Features: ssl
Feature: lz4
Description: Enable external LZ4 library support
Build-Depends: lz4
Feature: ssl
Description: Build with OpenSSL
Build-Depends: openssl
Feature: zlib
Description: Build with zlib
Build-Depends: zlib
Feature: zstd
Description: Build with zstd
Build-Depends: zstd

View File

@ -10,6 +10,30 @@ vcpkg_from_github(
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" RDKAFKA_BUILD_STATIC)
if("lz4" IN_LIST FEATURES)
set(ENABLE_LZ4_EXT ON)
else()
set(ENABLE_LZ4_EXT OFF)
endif()
if("ssl" IN_LIST FEATURES)
set(WITH_SSL ON)
else()
set(WITH_SSL OFF)
endif()
if("zlib" IN_LIST FEATURES)
set(WITH_ZLIB ON)
else()
set(WITH_ZLIB OFF)
endif()
if("zstd" IN_LIST FEATURES)
set(WITH_ZSTD ON)
else()
set(WITH_ZSTD OFF)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
@ -17,14 +41,20 @@ vcpkg_configure_cmake(
-DRDKAFKA_BUILD_STATIC=${RDKAFKA_BUILD_STATIC}
-DRDKAFKA_BUILD_EXAMPLES=OFF
-DRDKAFKA_BUILD_TESTS=OFF
-DENABLE_LZ4_EXT=${ENABLE_LZ4_EXT}
-DWITH_SSL=${WITH_SSL}
-DWITH_ZLIB=${WITH_ZLIB}
-DWITH_ZSTD=${WITH_ZSTD}
OPTIONS_DEBUG
-DENABLE_DEVEL=ON
-DENABLE_REFCNT_DEBUG=ON
-DENABLE_SHAREDPTR_DEBUG=ON
-DWITHOUT_OPTIMIZATION=ON
OPTIONS_RELEASE
-DENABLE_DEVEL=OFF
-DENABLE_REFCNT_DEBUG=OFF
-DENABLE_SHAREDPTR_DEBUG=OFF
-DWITHOUT_OPTIMIZATION=OFF
)
vcpkg_install_cmake()