Update gatherutils CMakeLists to use X86_INTRINSICS_FLAGS from cpu_features

This commit is contained in:
Maksim Kita 2022-03-30 18:40:18 +02:00
parent 91eec8962f
commit 8d0a9689e4

View File

@ -1,5 +1,4 @@
include("${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake") include("${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake")
option(ENABLE_AVX2 "Enable AVX2 instructions (when available) when build for modern Intel CPUs" OFF)
add_headers_and_sources(clickhouse_functions_gatherutils .) add_headers_and_sources(clickhouse_functions_gatherutils .)
add_library(clickhouse_functions_gatherutils ${clickhouse_functions_gatherutils_sources} ${clickhouse_functions_gatherutils_headers}) add_library(clickhouse_functions_gatherutils ${clickhouse_functions_gatherutils_sources} ${clickhouse_functions_gatherutils_headers})
@ -17,11 +16,4 @@ if (STRIP_DEBUG_SYMBOLS_FUNCTIONS)
target_compile_options(clickhouse_functions_gatherutils PRIVATE "-g0") target_compile_options(clickhouse_functions_gatherutils PRIVATE "-g0")
endif() endif()
if (HAVE_SSE42) set_target_properties(clickhouse_functions_gatherutils PROPERTIES COMPILE_FLAGS "${X86_INTRINSICS_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
target_compile_options(clickhouse_functions_gatherutils PRIVATE -msse4.2)
endif()
if (HAVE_AVX2 AND ENABLE_AVX2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -DENABLE_AVX2")
target_compile_options(clickhouse_functions_gatherutils PRIVATE -mavx2)
endif()