[cppkafka] bumped to 0.4.0 (#31182)

In this version some of the issues were solved:
1. No need for dynamic fix patch as it was solved inside the project.
2. CMake configs are installed
This commit is contained in:
Nikita Vakula 2023-05-02 21:40:04 +02:00 committed by GitHub
parent 845b32161f
commit fbec0d7bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 96 additions and 20 deletions

View File

@ -0,0 +1,38 @@
From fb7cbb0648948b51f71aefaa6b2354846f72439f Mon Sep 17 00:00:00 2001
From: Nikita Vakula <programmistov.programmist@gmail.com>
Date: Mon, 1 May 2023 23:12:09 +0200
Subject: [PATCH 1/2] Use correct rdkafka .pc
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
---
CMakeLists.txt | 1 +
cmake/cppkafka.pc.in | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4e44e6..e34c071 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,6 +92,7 @@ endif()
if (CPPKAFKA_RDKAFKA_STATIC_LIB)
add_definitions("-DLIBRDKAFKA_STATICLIB")
+ set(RDKAFKA_STATIC "-static")
endif()
if (NOT CPPKAFKA_CONFIG_DIR)
diff --git a/cmake/cppkafka.pc.in b/cmake/cppkafka.pc.in
index b5d432c..4e50860 100644
--- a/cmake/cppkafka.pc.in
+++ b/cmake/cppkafka.pc.in
@@ -9,6 +9,6 @@ Url: https://github.com/mfontanini/cppkafka
Description: C++ wrapper library on top of RdKafka
Version: @CPPKAFKA_VERSION@
Requires:
-Requires.private: rdkafka >= 0.9.4
+Requires.private: rdkafka@RDKAFKA_STATIC@ >= 0.9.4
Libs: -L${libdir} -L${sharedlibdir} -lcppkafka
Cflags: -I${includedir} -I${includedir}/cppkafka -I@Boost_INCLUDE_DIRS@
--
2.37.1 (Apple Git-137.1)

View File

@ -0,0 +1,27 @@
From e2c9c0a1cee07c6cacedd682d3506b447c2c561b Mon Sep 17 00:00:00 2001
From: Nikita Vakula <programmistov.programmist@gmail.com>
Date: Mon, 1 May 2023 23:11:19 +0200
Subject: [PATCH 2/2] Remove min/max macros
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
---
src/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5b8649b..5c818ee 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -36,6 +36,9 @@ set(NAMESPACE "${PROJECT_NAME}::")
set(TARGET_EXPORT_NAME ${PROJECT_NAME}Targets)
add_library(${TARGET_NAME} ${CPPKAFKA_LIBRARY_TYPE} ${SOURCES})
+if (MSVC)
+ target_compile_definitions(${TARGET_NAME} PRIVATE NOMINMAX)
+endif ()
target_include_directories(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include/cppkafka>)
set_target_properties(${TARGET_NAME} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}"
--
2.37.1 (Apple Git-137.1)

View File

@ -1,12 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5d31078..b1d3634 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -43,6 +43,7 @@ target_include_directories(cppkafka PUBLIC ${PROJECT_SOURCE_DIR}/include)
install(
TARGETS cppkafka
+ RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT dev

View File

@ -1,32 +1,47 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mfontanini/cppkafka
REF "v${VERSION}"
SHA512 60d01ce1dd9bd9119676be939ed5ab03539abb1f945c1b31e432edfe0f06542778f7fef37696f5ff19c53024f44d5cbd8aeddbbb231c38b098e05285d3ff0cab
REF "${VERSION}"
SHA512 86ac1500bdf6746a5e44e9ca4a4063eabcacec68b26c6846f7e7d47fe947309fc98a47986ab060d793096665d1cdc24044334267eb579cdb191f539bf96a3294
HEAD_REF master
PATCHES fix-dynamic.patch
PATCHES
0001-Fix-static-lib.patch
0002-Remove-min-max-macros.patch
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(CPPKAFKA_BUILD_SHARED OFF)
set(CPPKAFKA_RDKAFKA_STATIC_LIB ON)
else()
set(CPPKAFKA_BUILD_SHARED ON)
set(CPPKAFKA_RDKAFKA_STATIC_LIB OFF)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DCMAKE_CXX_STANDARD=11
-DCPPKAFKA_BUILD_SHARED=${CPPKAFKA_BUILD_SHARED}
-DCPPKAFKA_DISABLE_TESTS=ON
-DCPPKAFKA_DISABLE_EXAMPLES=ON
-DCPPKAFKA_PKGCONFIG_DIR=lib/pkgconfig
-DCPPKAFKA_RDKAFKA_STATIC_LIB=${CPPKAFKA_RDKAFKA_STATIC_LIB}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_cmake_config_fixup(
CONFIG_PATH lib/cmake/CppKafka
)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
vcpkg_fixup_pkgconfig()

View File

@ -1,7 +1,6 @@
{
"name": "cppkafka",
"version": "0.3.1",
"port-version": 5,
"version": "0.4.0",
"description": "cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum.",
"homepage": "https://github.com/mfontanini/cppkafka",
"license": "BSD-2-Clause",
@ -11,6 +10,10 @@
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -1785,8 +1785,8 @@
"port-version": 3
},
"cppkafka": {
"baseline": "0.3.1",
"port-version": 5
"baseline": "0.4.0",
"port-version": 0
},
"cppmicroservices": {
"baseline": "3.6.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "708cf007605104bc59394d47c9937b203c155b37",
"version": "0.4.0",
"port-version": 0
},
{
"git-tree": "a33f71df221cb16bb2f7b1ce5d9cd0043a525e00",
"version": "0.3.1",