Remove unbundled farmhash support

This commit is contained in:
Azat Khuzhin 2022-01-17 22:16:12 +03:00
parent f1cc63d900
commit 48b5c098dd
6 changed files with 11 additions and 58 deletions

View File

@ -523,8 +523,6 @@ include (cmake/find/cassandra.cmake)
include (cmake/find/sentry.cmake)
include (cmake/find/datasketches.cmake)
find_contrib_lib(farmhash)
if (ENABLE_TESTS)
include (cmake/find/gtest.cmake)
endif ()

View File

@ -1,44 +0,0 @@
# - Try to find farmhash headers and libraries.
#
# Usage of this module as follows:
#
# find_package(farmhash)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# FARMHASH_ROOT_DIR Set this variable to the root installation of
# farmhash if the module has problems finding
# the proper installation path.
#
# Variables defined by this module:
#
# FARMHASH_FOUND System has farmhash libs/headers
# FARMHASH_LIBRARIES The farmhash library/libraries
# FARMHASH_INCLUDE_DIR The location of farmhash headers
find_path(FARMHASH_ROOT_DIR
NAMES include/farmhash.h
)
find_library(FARMHASH_LIBRARIES
NAMES farmhash
PATHS ${FARMHASH_ROOT_DIR}/lib ${FARMHASH_LIBRARIES_PATHS}
)
find_path(FARMHASH_INCLUDE_DIR
NAMES farmhash.h
PATHS ${FARMHASH_ROOT_DIR}/include ${FARMHASH_INCLUDE_PATHS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(farmhash DEFAULT_MSG
FARMHASH_LIBRARIES
FARMHASH_INCLUDE_DIR
)
mark_as_advanced(
FARMHASH_ROOT_DIR
FARMHASH_LIBRARIES
FARMHASH_INCLUDE_DIR
)

View File

@ -78,10 +78,7 @@ endif()
# TODO: refactor the contrib libraries below this comment.
add_subdirectory (cityhash102)
if (USE_INTERNAL_FARMHASH_LIBRARY)
add_subdirectory (libfarmhash)
endif ()
add_subdirectory (libfarmhash)
if (USE_INTERNAL_H3_LIBRARY)
add_subdirectory(h3-cmake)

View File

@ -1,9 +1,11 @@
add_library(farmhash
farmhash.cc
farmhash.h)
add_library(_farmhash
farmhash.cc
farmhash.h)
if (MSVC)
target_compile_definitions (farmhash PRIVATE FARMHASH_NO_BUILTIN_EXPECT=1)
target_compile_definitions (_farmhash PRIVATE FARMHASH_NO_BUILTIN_EXPECT=1)
endif ()
target_include_directories (farmhash PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (_farmhash BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_library(ch_contrib::farmhash ALIAS _farmhash)

View File

@ -14,7 +14,7 @@ target_link_libraries(clickhouse_functions
PUBLIC
${BASE64_LIBRARY}
ch_contrib::cityhash
${FARMHASH_LIBRARIES}
ch_contrib::farmhash
${FASTOPS_LIBRARY}
clickhouse_dictionaries
clickhouse_dictionaries_embedded

View File

@ -5,7 +5,7 @@ add_executable (hash_map_lookup hash_map_lookup.cpp)
target_link_libraries (hash_map_lookup PRIVATE dbms)
add_executable (hash_map3 hash_map3.cpp)
target_link_libraries (hash_map3 PRIVATE dbms ${FARMHASH_LIBRARIES} metrohash)
target_link_libraries (hash_map3 PRIVATE dbms ch_contrib::farmhash metrohash)
add_executable (hash_map_string hash_map_string.cpp)
target_link_libraries (hash_map_string PRIVATE dbms)
@ -14,7 +14,7 @@ add_executable (hash_map_string_2 hash_map_string_2.cpp)
target_link_libraries (hash_map_string_2 PRIVATE dbms)
add_executable (hash_map_string_3 hash_map_string_3.cpp)
target_link_libraries (hash_map_string_3 PRIVATE dbms ${FARMHASH_LIBRARIES} metrohash)
target_link_libraries (hash_map_string_3 PRIVATE dbms ch_contrib::farmhash metrohash)
add_executable (hash_map_string_small hash_map_string_small.cpp)
target_link_libraries (hash_map_string_small PRIVATE dbms)