ClickHouse/contrib/nuraft-cmake/CMakeLists.txt

46 lines
1.7 KiB
CMake
Raw Normal View History

2020-12-25 08:06:10 +00:00
set(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/NuRaft)
2020-12-24 20:10:47 +00:00
2020-12-25 08:06:10 +00:00
set(SRCS
${LIBRARY_DIR}/src/handle_priority.cxx
${LIBRARY_DIR}/src/buffer_serializer.cxx
${LIBRARY_DIR}/src/peer.cxx
${LIBRARY_DIR}/src/global_mgr.cxx
${LIBRARY_DIR}/src/buffer.cxx
${LIBRARY_DIR}/src/asio_service.cxx
${LIBRARY_DIR}/src/handle_client_request.cxx
${LIBRARY_DIR}/src/raft_server.cxx
${LIBRARY_DIR}/src/snapshot.cxx
${LIBRARY_DIR}/src/handle_commit.cxx
${LIBRARY_DIR}/src/error_code.cxx
${LIBRARY_DIR}/src/crc32.cxx
${LIBRARY_DIR}/src/handle_snapshot_sync.cxx
${LIBRARY_DIR}/src/stat_mgr.cxx
${LIBRARY_DIR}/src/handle_join_leave.cxx
${LIBRARY_DIR}/src/handle_user_cmd.cxx
${LIBRARY_DIR}/src/handle_custom_notification.cxx
${LIBRARY_DIR}/src/handle_vote.cxx
${LIBRARY_DIR}/src/launcher.cxx
${LIBRARY_DIR}/src/srv_config.cxx
${LIBRARY_DIR}/src/snapshot_sync_req.cxx
${LIBRARY_DIR}/src/handle_timeout.cxx
${LIBRARY_DIR}/src/handle_append_entries.cxx
${LIBRARY_DIR}/src/cluster_config.cxx
2020-12-24 20:10:47 +00:00
)
add_library(nuraft ${SRCS})
2020-12-25 11:04:39 +00:00
target_compile_definitions(nuraft PRIVATE USE_BOOST_ASIO=1 BOOST_ASIO_STANDALONE=1)
2020-12-24 20:10:47 +00:00
target_include_directories (nuraft SYSTEM PRIVATE ${LIBRARY_DIR}/include/libnuraft)
# for some reason include "asio.h" directly without "boost/" prefix.
target_include_directories (nuraft SYSTEM PRIVATE ${ClickHouse_SOURCE_DIR}/contrib/boost/boost)
2020-12-25 11:04:39 +00:00
2020-12-24 20:10:47 +00:00
target_link_libraries (nuraft PRIVATE boost::headers_only boost::coroutine)
2020-12-25 11:04:39 +00:00
if(OPENSSL_SSL_LIBRARY AND OPENSSL_CRYPTO_LIBRARY)
target_link_libraries (nuraft PRIVATE ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
endif()
2020-12-24 20:10:47 +00:00
target_include_directories (nuraft SYSTEM PUBLIC ${LIBRARY_DIR}/include)