2020-11-10 02:40:01 -05:00
|
|
|
set(srcs
|
2019-06-21 02:29:32 -04:00
|
|
|
"heap_caps.c"
|
|
|
|
"heap_caps_init.c"
|
2020-01-16 13:37:19 -05:00
|
|
|
"multi_heap.c"
|
|
|
|
"heap_tlsf.c")
|
2018-01-11 21:49:13 -05:00
|
|
|
|
|
|
|
if(NOT CONFIG_HEAP_POISONING_DISABLED)
|
2019-04-28 03:38:23 -04:00
|
|
|
list(APPEND srcs "multi_heap_poisoning.c")
|
2018-01-11 21:49:13 -05:00
|
|
|
endif()
|
|
|
|
|
2018-09-30 19:45:51 -04:00
|
|
|
if(CONFIG_HEAP_TASK_TRACKING)
|
2019-04-28 03:38:23 -04:00
|
|
|
list(APPEND srcs "heap_task_info.c")
|
2018-09-30 19:45:51 -04:00
|
|
|
endif()
|
|
|
|
|
2018-12-12 12:29:47 -05:00
|
|
|
if(CONFIG_HEAP_TRACING_STANDALONE)
|
2019-04-28 03:38:23 -04:00
|
|
|
list(APPEND srcs "heap_trace_standalone.c")
|
2019-07-24 13:20:11 -04:00
|
|
|
set_source_files_properties(heap_trace_standalone.c
|
|
|
|
PROPERTIES COMPILE_FLAGS
|
|
|
|
-Wno-frame-address)
|
2018-12-12 12:29:47 -05:00
|
|
|
endif()
|
|
|
|
|
2021-06-18 02:51:11 -04:00
|
|
|
# Add SoC memory layout to the sources
|
|
|
|
list(APPEND srcs "port/memory_layout_utils.c")
|
|
|
|
list(APPEND srcs "port/${target}/memory_layout.c")
|
|
|
|
|
|
|
|
|
2019-04-28 03:38:23 -04:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
INCLUDE_DIRS include
|
|
|
|
LDFRAGMENTS linker.lf
|
|
|
|
PRIV_REQUIRES soc)
|
2018-01-11 21:49:13 -05:00
|
|
|
|
|
|
|
if(CONFIG_HEAP_TRACING)
|
2018-02-26 23:45:30 -05:00
|
|
|
set(WRAP_FUNCTIONS
|
2018-05-01 02:54:27 -04:00
|
|
|
calloc
|
|
|
|
malloc
|
|
|
|
free
|
|
|
|
realloc
|
|
|
|
heap_caps_malloc
|
|
|
|
heap_caps_free
|
|
|
|
heap_caps_realloc
|
|
|
|
heap_caps_malloc_default
|
|
|
|
heap_caps_realloc_default)
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2018-02-26 23:45:30 -05:00
|
|
|
foreach(wrap ${WRAP_FUNCTIONS})
|
2019-06-04 07:05:33 -04:00
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${wrap}")
|
2018-02-26 23:45:30 -05:00
|
|
|
endforeach()
|
2019-12-18 11:04:49 -05:00
|
|
|
endif()
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2019-12-18 11:04:49 -05:00
|
|
|
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
|
|
|
|
idf_build_get_property(build_components BUILD_COMPONENTS)
|
|
|
|
if(freertos IN_LIST build_components)
|
|
|
|
target_compile_options(${COMPONENT_TARGET} PRIVATE "-DMULTI_HEAP_FREERTOS")
|
|
|
|
endif()
|
2018-02-26 23:45:30 -05:00
|
|
|
endif()
|