CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. set(srcs
  2. "heap_caps.c"
  3. "heap_caps_init.c"
  4. "multi_heap.c"
  5. "heap_tlsf.c")
  6. if(NOT CONFIG_HEAP_POISONING_DISABLED)
  7. list(APPEND srcs "multi_heap_poisoning.c")
  8. endif()
  9. if(CONFIG_HEAP_TASK_TRACKING)
  10. list(APPEND srcs "heap_task_info.c")
  11. endif()
  12. if(CONFIG_HEAP_TRACING_STANDALONE)
  13. list(APPEND srcs "heap_trace_standalone.c")
  14. set_source_files_properties(heap_trace_standalone.c
  15. PROPERTIES COMPILE_FLAGS
  16. -Wno-frame-address)
  17. endif()
  18. idf_component_register(SRCS "${srcs}"
  19. INCLUDE_DIRS include
  20. LDFRAGMENTS linker.lf
  21. PRIV_REQUIRES soc)
  22. if(CONFIG_HEAP_TRACING)
  23. set(WRAP_FUNCTIONS
  24. calloc
  25. malloc
  26. free
  27. realloc
  28. heap_caps_malloc
  29. heap_caps_free
  30. heap_caps_realloc
  31. heap_caps_malloc_default
  32. heap_caps_realloc_default)
  33. foreach(wrap ${WRAP_FUNCTIONS})
  34. target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${wrap}")
  35. endforeach()
  36. endif()
  37. if(NOT CMAKE_BUILD_EARLY_EXPANSION)
  38. idf_build_get_property(build_components BUILD_COMPONENTS)
  39. if(freertos IN_LIST build_components)
  40. target_compile_options(${COMPONENT_TARGET} PRIVATE "-DMULTI_HEAP_FREERTOS")
  41. endif()
  42. endif()