CMakeLists.txt 1.2 KB

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