2020-11-10 02:40:01 -05:00
|
|
|
set(srcs
|
2019-06-21 02:29:32 -04:00
|
|
|
"app_trace.c"
|
|
|
|
"app_trace_util.c"
|
|
|
|
"host_file_io.c"
|
|
|
|
"gcov/gcov_rtio.c")
|
|
|
|
|
2019-04-28 03:38:23 -04:00
|
|
|
set(include_dirs "include")
|
2018-01-19 00:22:08 -05:00
|
|
|
|
2020-12-21 12:17:42 -05:00
|
|
|
set(priv_include_dirs "private_include" "port/include")
|
|
|
|
|
|
|
|
if(CONFIG_APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE)
|
|
|
|
list(APPEND srcs
|
|
|
|
"app_trace_membufs_proto.c")
|
|
|
|
|
|
|
|
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
|
|
|
list(APPEND srcs
|
|
|
|
"port/xtensa/port.c")
|
|
|
|
endif()
|
2021-05-28 17:20:02 -04:00
|
|
|
if(CONFIG_IDF_TARGET_ARCH_RISCV)
|
|
|
|
list(APPEND srcs
|
|
|
|
"port/riscv/port.c")
|
|
|
|
endif()
|
2020-12-21 12:17:42 -05:00
|
|
|
endif()
|
2021-09-18 09:38:07 -04:00
|
|
|
list(APPEND srcs
|
|
|
|
"port/port_uart.c")
|
2020-12-21 12:17:42 -05:00
|
|
|
|
|
|
|
if(CONFIG_APPTRACE_SV_ENABLE)
|
2019-04-28 03:38:23 -04:00
|
|
|
list(APPEND include_dirs
|
2018-02-27 01:44:31 -05:00
|
|
|
sys_view/Config
|
|
|
|
sys_view/SEGGER
|
|
|
|
sys_view/Sample/OS)
|
|
|
|
|
2020-11-10 02:40:01 -05:00
|
|
|
list(APPEND srcs
|
2019-06-21 02:29:32 -04:00
|
|
|
"sys_view/SEGGER/SEGGER_SYSVIEW.c"
|
|
|
|
"sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c"
|
|
|
|
"sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c"
|
2020-12-21 12:17:42 -05:00
|
|
|
"sys_view/esp/SEGGER_RTT_esp.c"
|
2019-06-21 02:29:32 -04:00
|
|
|
"sys_view/ext/heap_trace_module.c"
|
|
|
|
"sys_view/ext/logging.c")
|
2018-12-12 12:35:17 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_HEAP_TRACING_TOHOST)
|
2019-04-28 03:38:23 -04:00
|
|
|
list(APPEND srcs "heap_trace_tohost.c")
|
2019-07-24 13:20:11 -04:00
|
|
|
set_source_files_properties(heap_trace_tohost.c
|
|
|
|
PROPERTIES COMPILE_FLAGS
|
|
|
|
-Wno-frame-address)
|
2018-02-27 01:44:31 -05:00
|
|
|
endif()
|
|
|
|
|
2019-04-28 03:38:23 -04:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
INCLUDE_DIRS "${include_dirs}"
|
2020-12-21 12:17:42 -05:00
|
|
|
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
|
2022-01-28 06:47:04 -05:00
|
|
|
# Requires "driver" for GPTimer in "SEGGER_SYSVIEW_Config_FreeRTOS.c"
|
|
|
|
PRIV_REQUIRES soc driver
|
2022-04-16 05:32:22 -04:00
|
|
|
REQUIRES esp_timer
|
2019-04-28 03:38:23 -04:00
|
|
|
LDFRAGMENTS linker.lf)
|
2018-02-27 01:44:31 -05:00
|
|
|
|
2023-06-29 14:15:46 -04:00
|
|
|
if(CONFIG_APPTRACE_GCOV_ENABLE)
|
|
|
|
# disable --coverage for this component, as it is used as transport
|
|
|
|
# for gcov
|
|
|
|
target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
|
|
|
|
# Force app_trace to also appear later than gcov in link line
|
|
|
|
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE
|
|
|
|
"-Wl,--undefined=gcov_rtio_atexit" $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
|
|
|
|
endif()
|
2021-09-18 09:38:07 -04:00
|
|
|
|
|
|
|
# This function adds a dependency on the given component if the component is included into the build.
|
|
|
|
function(maybe_add_component component_name)
|
|
|
|
idf_build_get_property(components BUILD_COMPONENTS)
|
|
|
|
if(${component_name} IN_LIST components)
|
|
|
|
idf_component_get_property(lib_name ${component_name} COMPONENT_LIB)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC ${lib_name})
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
if(CONFIG_APPTRACE_DEST_UART0 OR CONFIG_APPTRACE_DEST_UART1 OR CONFIG_APPTRACE_DEST_UART2)
|
|
|
|
maybe_add_component(driver)
|
|
|
|
endif()
|