[clickhouse-cpp] Add new port (#7880)

* cityhash

* clickhouse-cpp

* add LZ4_DISABLE_DEPRECATE_WARNINGS

* add CXX_STANDARD 11

* remove 'usage' file

* tabs -> spaces

* use version of 2019-05-22 instead of patching code

* fix: remove ports/cityhash/usage
This commit is contained in:
zi-m 2019-09-26 21:56:46 +02:00 committed by dan-shaw
parent 4afc873253
commit 22389a4690
4 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,42 @@
diff --git a/clickhouse/base/compressed.cpp b/clickhouse/base/compressed.cpp
index 6b7af08..c3a6449 100644
--- a/clickhouse/base/compressed.cpp
+++ b/clickhouse/base/compressed.cpp
@@ -1,8 +1,8 @@
#include "compressed.h"
#include "wire_format.h"
-#include <cityhash/city.h>
-#include <lz4/lz4.h>
+#include <city.h>
+#include <lz4.h>
#include <system_error>
diff --git a/clickhouse/client.cpp b/clickhouse/client.cpp
index 1053006..59950ab 100644
--- a/clickhouse/client.cpp
+++ b/clickhouse/client.cpp
@@ -8,8 +8,8 @@
#include "columns/factory.h"
-#include <cityhash/city.h>
-#include <lz4/lz4.h>
+#include <city.h>
+#include <lz4.h>
#include <assert.h>
#include <atomic>
diff --git a/clickhouse/types/types.h b/clickhouse/types/types.h
index 8d453cd..69aa6a4 100644
--- a/clickhouse/types/types.h
+++ b/clickhouse/types/types.h
@@ -4,6 +4,7 @@
#include <memory>
#include <string>
#include <vector>
+#include <stdexcept>
namespace clickhouse {

View File

@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.13)
project(clickhouse-cpp CXX)
find_package(lz4 CONFIG REQUIRED)
find_package(cityhash CONFIG REQUIRED)
file(GLOB_RECURSE SOURCES "clickhouse/*.cpp")
file(GLOB_RECURSE HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "clickhouse/*.h")
add_library(clickhouse-cpp STATIC ${SOURCES})
target_compile_definitions(clickhouse-cpp PRIVATE LZ4_DISABLE_DEPRECATE_WARNINGS)
set_target_properties(clickhouse-cpp PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON
)
target_include_directories(clickhouse-cpp PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_link_libraries(clickhouse-cpp
PRIVATE lz4::lz4
PRIVATE cityhash
)
install(TARGETS clickhouse-cpp EXPORT clickhouse-cpp-config
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(EXPORT clickhouse-cpp-config DESTINATION share/cmake/clickhouse-cpp)
foreach (HEADER ${HEADERS} )
get_filename_component(HEADER_DIR ${HEADER} DIRECTORY)
install(FILES ${HEADER} DESTINATION include/${HEADER_DIR})
endforeach()

View File

@ -0,0 +1,5 @@
Source: clickhouse-cpp
Version: 2019-05-22
Build-Depends: lz4, cityhash
Homepage: https://github.com/artpaul/clickhouse-cpp
Description: C++ client for Yandex ClickHouse.

View File

@ -0,0 +1,28 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO artpaul/clickhouse-cpp
REF 1634d8b9e2f3183de1574344563d90557be3b305
SHA512 bef74f624c2a777f8ec6b7e87ac3cc564e914bcecc639b3889695da56be4c90531309a8fd87054c2777580c36bc3b2d6e9c5690a6345018bf65a5294eeeb3390
HEAD_REF master
PATCHES 00001-fix-build.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/clickhouse-cpp)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/clickhouse-cpp/copyright COPYONLY)