-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
845b321
commit fbec0d7
Showing
7 changed files
with
96 additions
and
20 deletions.
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,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) | ||
|
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,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) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
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