CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. set(srcs
  2. "app_trace.c"
  3. "app_trace_util.c"
  4. "host_file_io.c"
  5. "gcov/gcov_rtio.c")
  6. set(include_dirs "include")
  7. if(CONFIG_SYSVIEW_ENABLE)
  8. list(APPEND include_dirs
  9. sys_view/Config
  10. sys_view/SEGGER
  11. sys_view/Sample/OS)
  12. list(APPEND srcs
  13. "sys_view/SEGGER/SEGGER_SYSVIEW.c"
  14. "sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c"
  15. "sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c"
  16. "sys_view/esp32/SEGGER_RTT_esp32.c"
  17. "sys_view/ext/heap_trace_module.c"
  18. "sys_view/ext/logging.c")
  19. endif()
  20. if(CONFIG_HEAP_TRACING_TOHOST)
  21. list(APPEND srcs "heap_trace_tohost.c")
  22. set_source_files_properties(heap_trace_tohost.c
  23. PROPERTIES COMPILE_FLAGS
  24. -Wno-frame-address)
  25. endif()
  26. idf_component_register(SRCS "${srcs}"
  27. INCLUDE_DIRS "${include_dirs}"
  28. PRIV_REQUIRES soc
  29. LDFRAGMENTS linker.lf)
  30. # disable --coverage for this component, as it is used as transport
  31. # for gcov
  32. target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
  33. # Force app_trace to also appear later than gcov in link line
  34. idf_component_get_property(app_trace app_trace COMPONENT_LIB)
  35. target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)