From 75a298a2753852618b700b112aef57e2e5b446fb Mon Sep 17 00:00:00 2001 From: Suzy Wang Date: Tue, 6 Dec 2022 14:02:22 -0800 Subject: [PATCH] fix cmake --- contrib/crc32-s390x-cmake/CMakeLists.txt | 12 ++++++++++-- src/CMakeLists.txt | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/crc32-s390x-cmake/CMakeLists.txt b/contrib/crc32-s390x-cmake/CMakeLists.txt index 3df9474c409..25763ebb77d 100644 --- a/contrib/crc32-s390x-cmake/CMakeLists.txt +++ b/contrib/crc32-s390x-cmake/CMakeLists.txt @@ -9,9 +9,17 @@ endif() set(CRC32_S390X_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/crc32-s390x) set(CRC32_S390X_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/crc32-s390x) -set(CRC32_SRCS "${CRC32_S390X_SOURCE_DIR}/crc32-s390x.c") +set(CRC32_SRCS + "${CRC32_S390X_SOURCE_DIR}/crc32-s390x.c" + "${CRC32_S390X_SOURCE_DIR}/crc32be-vx.S" + "${CRC32_S390X_SOURCE_DIR}/crc32le-vx.S" +) -add_library(_crc32_s390x ${CRC32_SRCS}) +set(CRC32_HDRS + "${CRC32_S390X_INCLUDE_DIR}/crc32-s390x.h" +) + +add_library(_crc32_s390x ${CRC32_SRCS} ${CRC32_HDRS}) target_include_directories(_crc32_s390x SYSTEM PUBLIC "${CRC32_S390X_INCLUDE_DIR}") target_compile_definitions(_crc32_s390x PUBLIC) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce2cc862b32..642240b9e21 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -387,6 +387,10 @@ if (TARGET ch_contrib::cpuid) target_link_libraries(clickhouse_common_io PRIVATE ch_contrib::cpuid) endif() +if (TARGET ch_contrib::crc32_s390x) + target_link_libraries(clickhouse_common_io PRIVATE ch_contrib::crc32_s390x) +endif() + dbms_target_link_libraries(PUBLIC ch_contrib::abseil_swiss_tables) # Make dbms depend on roaring instead of clickhouse_common_io so that roaring itself can depend on clickhouse_common_io