#  Copyright (C) GridGain Systems. All Rights Reserved.
#  _________        _____ __________________        _____
#  __  ____/___________(_)______  /__  ____/______ ____(_)_______
#  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
#  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
#  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/

set(TARGET gridgain-protocol)

set(PUBLIC_HEADERS)

set(PRIVATE_HEADERS
    bitmask_feature.h
    bitset_span.h
    buffer_adapter.h
    client_operation.h
    extension_types.h
    heartbeat_timeout.h
    messages.h
    protocol_context.h
    protocol_version.h
    reader.h
    sql/column_meta.h
    utils.h
    writer.h
)

ignite_check_headers(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${PUBLIC_HEADERS} PRIVATE ${PRIVATE_HEADERS})

ignite_collect_public_headers(protocol PUBLIC_HEADERS)

set(SOURCES
    sql/column_meta.cpp sql/column_meta.h
    bitset_span.h
    buffer_adapter.cpp buffer_adapter.h
    extension_types.h
    heartbeat_timeout.h
    messages.cpp messages.h
    partition_assignment.h
    protocol_context.h
    protocol_version.cpp protocol_version.h
    reader.cpp reader.h
    utils.cpp utils.h
    writer.cpp writer.h
)

add_library(${TARGET} OBJECT ${SOURCES})
target_link_libraries(${TARGET} PUBLIC gridgain-common msgpack-c)

set_target_properties(${TARGET} PROPERTIES VERSION ${IGNITE_VERSION_3})
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE 1)
