-
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.
[clickhouse-cpp] Update to 2.2.1 (#27250)
* [clickhouse-cpp] Update to 2.2.1 * add feature openssl * Fix patch * use absl::int128 * Fix patch * version * fix UWP * version
- Loading branch information
1 parent
6ee2fa9
commit ca79ebe
Showing
8 changed files
with
135 additions
and
43 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,88 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 31cd8a5..d8ee404 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -29,11 +29,12 @@ PROJECT (CLICKHOUSE-CLIENT) | ||
INCLUDE_DIRECTORIES (.) | ||
INCLUDE_DIRECTORIES (contrib) | ||
|
||
+ find_package(absl CONFIG REQUIRED) | ||
+ find_package(cityhash CONFIG REQUIRED) | ||
+ find_package(lz4 CONFIG REQUIRED) | ||
+ | ||
SUBDIRS ( | ||
clickhouse | ||
- contrib/absl | ||
- contrib/cityhash | ||
- contrib/lz4 | ||
) | ||
|
||
IF (BUILD_BENCHMARK) | ||
diff --git a/clickhouse/CMakeLists.txt b/clickhouse/CMakeLists.txt | ||
index d96ff88..ad1cb0d 100644 | ||
--- a/clickhouse/CMakeLists.txt | ||
+++ b/clickhouse/CMakeLists.txt | ||
@@ -36,19 +36,21 @@ IF (WITH_OPENSSL) | ||
LIST(APPEND clickhouse-cpp-lib-src base/sslsocket.cpp) | ||
ENDIF () | ||
|
||
-ADD_LIBRARY (clickhouse-cpp-lib SHARED ${clickhouse-cpp-lib-src}) | ||
-SET_TARGET_PROPERTIES(clickhouse-cpp-lib PROPERTIES LINKER_LANGUAGE CXX) | ||
-TARGET_LINK_LIBRARIES (clickhouse-cpp-lib | ||
- absl-lib | ||
- cityhash-lib | ||
- lz4-lib | ||
-) | ||
- | ||
-ADD_LIBRARY (clickhouse-cpp-lib-static STATIC ${clickhouse-cpp-lib-src}) | ||
-TARGET_LINK_LIBRARIES (clickhouse-cpp-lib-static | ||
- absl-lib | ||
- cityhash-lib | ||
- lz4-lib | ||
+set(LIB_NAME "") | ||
+ | ||
+if(BUILD_SHARED_LIBS) | ||
+ ADD_LIBRARY (clickhouse-cpp-lib SHARED ${clickhouse-cpp-lib-src}) | ||
+ SET_TARGET_PROPERTIES(clickhouse-cpp-lib PROPERTIES LINKER_LANGUAGE CXX) | ||
+ set(LIB_NAME "clickhouse-cpp-lib") | ||
+else() | ||
+ ADD_LIBRARY (clickhouse-cpp-lib-static STATIC ${clickhouse-cpp-lib-src}) | ||
+ set(LIB_NAME "clickhouse-cpp-lib-static") | ||
+endif() | ||
+ | ||
+TARGET_LINK_LIBRARIES ("${LIB_NAME}" | ||
+ absl::base absl::numeric | ||
+ cityhash | ||
+ lz4::lz4 | ||
) | ||
|
||
IF (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
@@ -68,12 +70,11 @@ IF (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
# /usr/bin/ld: CMakeFiles/simple-test.dir/main.cpp.o: undefined reference to symbol '_Unwind_Resume@@GCC_3.0' | ||
# /usr/bin/ld: /lib/x86_64-linux-gnu/libgcc_s.so.1: error adding symbols: DSO missing from command line | ||
# FIXME: that workaround breaks clang build on mingw | ||
- TARGET_LINK_LIBRARIES (clickhouse-cpp-lib gcc_s) | ||
- TARGET_LINK_LIBRARIES (clickhouse-cpp-lib-static gcc_s) | ||
+ TARGET_LINK_LIBRARIES (${LIB_NAME} gcc_s) | ||
ENDIF () | ||
ENDIF () | ||
|
||
-INSTALL (TARGETS clickhouse-cpp-lib clickhouse-cpp-lib-static | ||
+INSTALL (TARGETS ${LIB_NAME} | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
) | ||
@@ -123,11 +124,9 @@ INSTALL(FILES types/type_parser.h DESTINATION include/clickhouse/types/) | ||
INSTALL(FILES types/types.h DESTINATION include/clickhouse/types/) | ||
|
||
IF (WITH_OPENSSL) | ||
- TARGET_LINK_LIBRARIES (clickhouse-cpp-lib OpenSSL::SSL) | ||
- TARGET_LINK_LIBRARIES (clickhouse-cpp-lib-static OpenSSL::SSL) | ||
+ TARGET_LINK_LIBRARIES (${LIB_NAME} OpenSSL::SSL) | ||
ENDIF () | ||
|
||
IF (WIN32 OR MINGW) | ||
- TARGET_LINK_LIBRARIES (clickhouse-cpp-lib wsock32 ws2_32) | ||
- TARGET_LINK_LIBRARIES (clickhouse-cpp-lib-static wsock32 ws2_32) | ||
+ TARGET_LINK_LIBRARIES (${LIB_NAME} wsock32 ws2_32) | ||
ENDIF () |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/clickhouse/base/socket.cpp b/clickhouse/base/socket.cpp | ||
index c6dc920..43bbd02 100644 | ||
--- a/clickhouse/base/socket.cpp | ||
+++ b/clickhouse/base/socket.cpp | ||
@@ -27,7 +27,7 @@ char const* windowsErrorCategory::name() const noexcept { | ||
|
||
std::string windowsErrorCategory::message(int c) const { | ||
char error[UINT8_MAX]; | ||
- auto len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, static_cast<DWORD>(c), 0, error, sizeof(error), nullptr); | ||
+ auto len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, static_cast<DWORD>(c), 0, error, sizeof(error), nullptr); | ||
if (len == 0) { | ||
return "unknown"; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
{ | ||
"name": "clickhouse-cpp", | ||
"version": "1.5.0", | ||
"version": "2.2.1", | ||
"description": "C++ client for Yandex ClickHouse", | ||
"homepage": "https://github.com/ClickHouse/clickhouse-cpp", | ||
"license": "Apache-2.0", | ||
"dependencies": [ | ||
"abseil", | ||
"cityhash", | ||
"lz4", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
], | ||
"features": { | ||
"openssl": { | ||
"description": "Enable OpenSSL support", | ||
"dependencies": [ | ||
"openssl" | ||
] | ||
} | ||
} | ||
} |
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