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