##################################################################
# File Descriptor : Module CMakeLists Template
# Author : Lucien Yin
# History :
#          2020-03-18 Create
# Copyright : 2020 Unisoc, Incoporated. All Rights Reserved.
##################################################################
cmake_minimum_required(VERSION 3.13)

# Create Library , Named MMM
cp_internal_library_register(MMM #module name
                             0 # close source or not 0-open_source 1-close_source
                             )

#
#############################################################
#     Create static Library and add source code
# Create Library and add Curent Library to project library list
#############################################################
#
set(SRCS 
    "src/XXX.c"
    "src/YYY.c"
)

if(CONFIG_XXX)
    list(APPEND SRCS 
        "src/ZZZ.c"
    )
endif()

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

#
#############################################################
# Public curent header file to total project
# Add the directory to INTERFACE LIBRARY
#############################################################
#
if(0)
cp_include_directories(
    ${CP_BASE}/chip_drv_pm/export/inc
    ${CP_BASE}/ms_ref/export/inc
    ${CP_BASE}/ms_ref/source/sipc_sp/inc
    ${CP_BASE}/rtos/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
if(0)
    cp_library_sources_ifdef(CONFIG_XXX xxx.c)
else()
    cp_library_sources(${SRCS})
endif()

