Move all url functions to clickhouse_functions_url lib (#5696)

This commit is contained in:
proller 2019-06-20 18:49:54 +03:00 committed by GitHub
parent 4cc9f632a0
commit fa809de91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 63 additions and 46 deletions

View File

@ -344,6 +344,7 @@ find_contrib_lib(metrohash)
find_contrib_lib(btrie)
find_contrib_lib(double-conversion)
include (cmake/find_parquet.cmake)
include (cmake/find_gperf.cmake)
if (ENABLE_TESTS)
include (cmake/find_gtest.cmake)

View File

@ -21,8 +21,8 @@ list(REMOVE_ITEM clickhouse_aggregate_functions_headers
add_library(clickhouse_aggregate_functions ${clickhouse_aggregate_functions_sources})
target_link_libraries(clickhouse_aggregate_functions PRIVATE dbms PUBLIC ${CITYHASH_LIBRARIES})
target_include_directories (clickhouse_aggregate_functions BEFORE PRIVATE ${COMMON_INCLUDE_DIR})
target_include_directories(clickhouse_aggregate_functions PRIVATE ${COMMON_INCLUDE_DIR})
if (ENABLE_TESTS)
add_subdirectory (tests)
endif ()
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()

View File

@ -1,20 +1,9 @@
include (${ClickHouse_SOURCE_DIR}/cmake/find_gperf.cmake)
configure_file(config_functions.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config_functions.h)
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)
add_headers_and_sources(clickhouse_functions ./GatherUtils)
add_headers_and_sources(clickhouse_functions .)
if (USE_GPERF)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp
COMMAND ${GPERF} ${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.gperf --output-file=${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp
)
list(APPEND clickhouse_functions_sources ${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp)
endif ()
list(REMOVE_ITEM clickhouse_functions_sources IFunction.cpp FunctionFactory.cpp FunctionHelpers.cpp)
list(REMOVE_ITEM clickhouse_functions_headers IFunction.h FunctionFactory.h FunctionHelpers.h)
@ -89,3 +78,6 @@ endif()
if(USE_RAPIDJSON)
target_include_directories(clickhouse_functions SYSTEM PRIVATE ${RAPIDJSON_INCLUDE_DIR})
endif()
add_subdirectory(URL)
target_link_libraries(clickhouse_functions PRIVATE clickhouse_functions_url)

View File

@ -0,0 +1,27 @@
configure_file(config_functions_url.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config_functions_url.h)
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)
add_headers_and_sources(clickhouse_functions_url .)
if (USE_GPERF)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp
COMMAND ${GPERF} ${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.gperf --output-file=${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp
)
list(APPEND clickhouse_functions_url_sources ${CMAKE_CURRENT_BINARY_DIR}/tldLookup.cpp)
endif ()
add_library(clickhouse_functions_url ${clickhouse_functions_url_sources} ${clickhouse_functions_url_headers})
target_link_libraries(clickhouse_functions_url PRIVATE clickhouse_common_io)
target_include_directories(clickhouse_functions_url PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/../include)
if (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO" OR CMAKE_BUILD_TYPE_UC STREQUAL "MINSIZEREL")
# Won't generate debug info for files with heavy template instantiation to achieve faster linking and lower size.
target_compile_options(clickhouse_functions_url PRIVATE "-g0")
endif ()
# TODO: move Functions/Regexps.h to some lib and use here
if(USE_HYPERSCAN)
target_link_libraries(clickhouse_functions_url PRIVATE ${HYPERSCAN_LIBRARY})
target_include_directories(clickhouse_functions_url SYSTEM PRIVATE ${HYPERSCAN_INCLUDE_DIR})
endif()

View File

@ -1,6 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringArray.h>
#include <Functions/FunctionsURL.h>
namespace DB
{

View File

@ -1,6 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringArray.h>
#include <Functions/FunctionsURL.h>
namespace DB
{

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/FunctionsURL.h>
#include "FunctionsURL.h"
#include <common/find_symbols.h>
namespace DB

View File

@ -0,0 +1,5 @@
#pragma once
// .h autogenerated by cmake!
#cmakedefine01 USE_GPERF

View File

@ -1,5 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/fragment.h>
#include "fragment.h"
#include <Functions/FunctionStringToString.h>
namespace DB

View File

@ -1,5 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/queryString.h>
#include "queryString.h"
#include <Functions/FunctionStringToString.h>
namespace DB

View File

@ -1,5 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/queryStringAndFragment.h>
#include "queryStringAndFragment.h"
#include <Functions/FunctionStringToString.h>
namespace DB

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/firstSignificantSubdomain.h>
#include "firstSignificantSubdomain.h"
namespace DB

View File

@ -1,6 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringSearch.h>
#include <Functions/FunctionsURL.h>
#include <common/find_symbols.h>
namespace DB

View File

@ -1,7 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/FunctionsURL.h>
#include <Functions/protocol.h>
#include "protocol.h"
#include <common/find_symbols.h>

View File

@ -1,6 +1,5 @@
#include <Common/hex.h>
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsURL.h>
#include <Functions/FunctionStringToString.h>
#include <common/find_symbols.h>

View File

@ -1,6 +1,7 @@
#include "domain.h"
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/domain.h>
namespace DB
{

View File

@ -1,6 +1,6 @@
#pragma once
#include <Functions/protocol.h>
#include "protocol.h"
#include <common/find_symbols.h>
#include <cstring>

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/domain.h>
#include "domain.h"
namespace DB
{

View File

@ -1,6 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringSearch.h>
#include <Functions/FunctionsURL.h>
#include <common/find_symbols.h>
namespace DB

View File

@ -1,6 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringArray.h>
#include <Functions/FunctionsURL.h>
namespace DB
{

View File

@ -1,6 +1,5 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringArray.h>
#include <Functions/FunctionsURL.h>
namespace DB
{

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/firstSignificantSubdomain.h>
#include "firstSignificantSubdomain.h"
namespace DB

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/fragment.h>
#include "fragment.h"
namespace DB
{

View File

@ -1,6 +1,6 @@
#pragma once
#include <Functions/FunctionsURL.h>
#include "FunctionsURL.h"
#include <common/find_symbols.h>
namespace DB

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/FunctionsURL.h>
#include "FunctionsURL.h"
#include <common/find_symbols.h>
namespace DB

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/FunctionsURL.h>
#include "FunctionsURL.h"
#include <common/find_symbols.h>
namespace DB

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/protocol.h>
#include "protocol.h"
namespace DB

View File

@ -1,6 +1,6 @@
#pragma once
#include <Functions/FunctionsURL.h>
#include "FunctionsURL.h"
#include <Common/StringUtils/StringUtils.h>

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/queryString.h>
#include "queryString.h"
namespace DB
{

View File

@ -1,6 +1,6 @@
#pragma once
#include <Functions/FunctionsURL.h>
#include "FunctionsURL.h"
#include <common/find_symbols.h>

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/queryStringAndFragment.h>
#include "queryStringAndFragment.h"
namespace DB
{

View File

@ -1,6 +1,6 @@
#pragma once
#include <Functions/FunctionsURL.h>
#include "FunctionsURL.h"
#include <common/find_symbols.h>

View File

@ -1,6 +1,6 @@
#pragma once
#include "config_functions.h"
#include "config_functions_url.h"
#if USE_GPERF
// Definition of the class generated by gperf, present on gperf/tldLookup.gperf
class tldLookupHash

View File

@ -1,6 +1,6 @@
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionStringToString.h>
#include <Functions/domain.h>
#include "domain.h"
namespace DB
{

View File

@ -8,4 +8,3 @@
#cmakedefine01 USE_HYPERSCAN
#cmakedefine01 USE_SIMDJSON
#cmakedefine01 USE_RAPIDJSON
#cmakedefine01 USE_GPERF