CMakeLists.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. set(priv_include_dirs "private_include" "port/include")
  8. if(CONFIG_APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE)
  9. list(APPEND srcs
  10. "app_trace_membufs_proto.c")
  11. if(CONFIG_IDF_TARGET_ARCH_XTENSA)
  12. list(APPEND srcs
  13. "port/xtensa/port.c")
  14. endif()
  15. if(CONFIG_IDF_TARGET_ARCH_RISCV)
  16. list(APPEND srcs
  17. "port/riscv/port.c")
  18. endif()
  19. endif()
  20. if(CONFIG_APPTRACE_SV_ENABLE)
  21. list(APPEND include_dirs
  22. sys_view/Config
  23. sys_view/SEGGER
  24. sys_view/Sample/OS)
  25. list(APPEND srcs
  26. "sys_view/SEGGER/SEGGER_SYSVIEW.c"
  27. "sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c"
  28. "sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c"
  29. "sys_view/esp/SEGGER_RTT_esp.c"
  30. "sys_view/ext/heap_trace_module.c"
  31. "sys_view/ext/logging.c")
  32. endif()
  33. if(CONFIG_HEAP_TRACING_TOHOST)
  34. list(APPEND srcs "heap_trace_tohost.c")
  35. set_source_files_properties(heap_trace_tohost.c
  36. PROPERTIES COMPILE_FLAGS
  37. -Wno-frame-address)
  38. endif()
  39. idf_component_register(SRCS "${srcs}"
  40. INCLUDE_DIRS "${include_dirs}"
  41. PRIV_INCLUDE_DIRS "${priv_include_dirs}"
  42. PRIV_REQUIRES soc esp_ipc
  43. LDFRAGMENTS linker.lf)
  44. # disable --coverage for this component, as it is used as transport
  45. # for gcov
  46. target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
  47. # Force app_trace to also appear later than gcov in link line
  48. idf_component_get_property(app_trace app_trace COMPONENT_LIB)
  49. target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)