mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
55 lines
1.4 KiB
CMake
55 lines
1.4 KiB
CMake
set(srcs
|
|
"heap_caps.c"
|
|
"heap_caps_init.c"
|
|
"multi_heap.c"
|
|
"heap_tlsf.c")
|
|
|
|
if(NOT CONFIG_HEAP_POISONING_DISABLED)
|
|
list(APPEND srcs "multi_heap_poisoning.c")
|
|
endif()
|
|
|
|
if(CONFIG_HEAP_TASK_TRACKING)
|
|
list(APPEND srcs "heap_task_info.c")
|
|
endif()
|
|
|
|
if(CONFIG_HEAP_TRACING_STANDALONE)
|
|
list(APPEND srcs "heap_trace_standalone.c")
|
|
set_source_files_properties(heap_trace_standalone.c
|
|
PROPERTIES COMPILE_FLAGS
|
|
-Wno-frame-address)
|
|
endif()
|
|
|
|
# Add SoC memory layout to the sources
|
|
list(APPEND srcs "port/memory_layout_utils.c")
|
|
list(APPEND srcs "port/${target}/memory_layout.c")
|
|
|
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
INCLUDE_DIRS include
|
|
LDFRAGMENTS linker.lf
|
|
PRIV_REQUIRES soc)
|
|
|
|
if(CONFIG_HEAP_TRACING)
|
|
set(WRAP_FUNCTIONS
|
|
calloc
|
|
malloc
|
|
free
|
|
realloc
|
|
heap_caps_malloc
|
|
heap_caps_free
|
|
heap_caps_realloc
|
|
heap_caps_malloc_default
|
|
heap_caps_realloc_default)
|
|
|
|
foreach(wrap ${WRAP_FUNCTIONS})
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${wrap}")
|
|
endforeach()
|
|
endif()
|
|
|
|
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()
|
|
endif()
|