2021-04-13 19:23:11 +08:00
|
|
|
|
################# Add global include #################
|
2021-06-21 14:45:33 +08:00
|
|
|
|
list(APPEND ADD_INCLUDE
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ring_buffer"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/soft_crc"
|
2021-04-13 19:23:11 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/memheap"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/misc"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/list"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/device"
|
2021-06-04 17:45:27 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/partition"
|
2021-07-06 16:09:51 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/bl_math"
|
2021-07-28 15:06:39 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/pid"
|
2021-08-05 19:27:25 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/timestamp"
|
2021-04-13 19:23:11 +08:00
|
|
|
|
)
|
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
################# Add private include #################
|
2021-06-21 14:45:33 +08:00
|
|
|
|
# list(APPEND ADD_PRIVATE_INCLUDE
|
2021-04-13 19:23:11 +08:00
|
|
|
|
# )
|
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
############## Add current dir source files ###########
|
2021-06-21 14:45:33 +08:00
|
|
|
|
file(GLOB_RECURSE sources
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ring_buffer/*.c"
|
2021-04-13 19:23:11 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/soft_crc/*.c"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/memheap/*.c"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/misc/*.c"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/device/*.c"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/partition/*.c"
|
2021-07-06 16:09:51 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/bl_math/*.c"
|
2021-07-28 15:06:39 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/pid/*.c"
|
2021-08-05 19:27:25 +08:00
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/timestamp/*.c"
|
2021-04-13 19:23:11 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
#aux_source_directory(. sources)
|
|
|
|
|
list(APPEND ADD_SRCS ${sources})
|
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
########### Add required/dependent components #########
|
2021-04-27 12:35:37 +08:00
|
|
|
|
#list(APPEND ADD_REQUIREMENTS xxx)
|
2021-04-13 19:23:11 +08:00
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
############ Add static libs ##########################
|
2021-06-21 14:45:33 +08:00
|
|
|
|
#list(APPEND ADD_STATIC_LIB "libxxx.a")
|
2021-04-13 19:23:11 +08:00
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
############ Add dynamic libs #########################
|
2021-04-27 12:35:37 +08:00
|
|
|
|
# list(APPEND ADD_DYNAMIC_LIB "libxxx.so"
|
2021-04-13 19:23:11 +08:00
|
|
|
|
# )
|
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
############ Add global compile option ################
|
|
|
|
|
#add components denpend on this component
|
2021-07-28 15:06:39 +08:00
|
|
|
|
string(TOUPPER ${CHIP} CHIPNAME)
|
|
|
|
|
list(APPEND ADD_DEFINITIONS -D${CHIPNAME})
|
2021-04-13 19:23:11 +08:00
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
############ Add private compile option ################
|
2021-06-21 14:45:33 +08:00
|
|
|
|
#add compile option for this component that won't affect other modules
|
|
|
|
|
# list(APPEND ADD_PRIVATE_DEFINITIONS -Dxxx)
|
2021-04-13 19:23:11 +08:00
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
|
|
generate_library()
|