cmake_minimum_required(VERSION 3.13)

#
# Create Library and add Curent Library to project library list
#
# Create Library
cp_internal_library_register(sipc_mini 0)


#
#############################################################
#   Create static Library and add source code
# Create Library and add Curent Library to project library list
#############################################################
#
set(SRCS
    "sipc.c"
    "smsg.c"
    "smem.c"
    "sbuf.c"
    "sipc_os_adapter.c"
    "spipe.c"
)

if(CONFIG_SIPC_SEVENT_SUPPORT)
    list(APPEND SRCS
        "sevent.c"
    )
endif()

if(CONFIG_SIPC_TEST_SUPPORT)
    list(APPEND SRCS
        "sipc_test.c"
    )
endif()

#
#############################################################
# Add Internel depend header file
#############################################################
#
if(0)
cp_library_include_directories(
)
endif()

#
#############################################################
# Public curent header file to total project
# Add the directory to INTERFACE LIBRARY
#############################################################
#
cp_include_directories(
    ./inc
    ${PROJECT_SOURCE_ROOT}/chip_drv_ch/export/inc
    ${PROJECT_SOURCE_ROOT}/chip_drv_ch/chip_plf/${CONFIG_SOC_ID}/ch
    ${PROJECT_SOURCE_ROOT}/chip_drv_ch/chip_module/clock
    ${PROJECT_SOURCE_ROOT}/ms_ref/export/inc
    ${PROJECT_SOURCE_ROOT}/ms_ref/source/base/inc
    ${PROJECT_SOURCE_ROOT}/ms_ref/source/sipc_mini
    ${PROJECT_SOURCE_ROOT}/rtos/kernel/export/inc
)
#
# include sipc_cfg
#
cp_include_directories(
    ${PROJECT_SOURCE_ROOT}/ms_customize/source/product/config/${CONFIG_PRODUCT_CONFIG}
)

if(CONFIG_THREADX_VERSION_V56)
    cp_include_directories(
        ${PROJECT_SOURCE_ROOT}/rtos/kernel/export/inc
    )

endif()

#
#############################################################
# Extenel Libriry that need to link
#
#############################################################
#
#cp_library_link_libraries()


#
#############################################################
# The defined flags that compile need use
#############################################################
#
#cp_library_compile_definitions(SOC_SHARKL5PRO)


#
#############################################################
# The compile option flags that need use
#############################################################
#
#cp_library_cc_option()

#
# Add source code to library
#
#cp_library_sources_ifdef(CONFIG_APP main.c)
cp_library_sources(${SRCS})
