Files
esp-idf/components/esp_trace/CMakeLists.txt
Erhan Kurubas 1971a58caa change(esp_trace): compile hot path at -O2 regardless of project optimization
Every event record runs through this component, so -Og on the rest of the
project should not set the per-event tracing overhead.

(cherry picked from commit 44a38047bb)
2026-09-09 12:23:11 +02:00

47 lines
1.1 KiB
CMake

idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
return()
endif()
if(CONFIG_ESP_TRACE_ENABLE)
set(srcs
"src/core/esp_trace_core.c"
"src/core/esp_trace_registry.c"
"src/ports/port_utils.c"
)
if(CONFIG_ESP_TRACE_TRANSPORT_APPTRACE)
list(APPEND srcs "adapters/transport/adapter_transport_apptrace.c")
endif()
if(CONFIG_ESP_TRACE_TRANSPORT_USB_SERIAL_JTAG)
list(APPEND srcs "adapters/transport/adapter_transport_usb_serial_jtag.c")
endif()
endif()
set(includes
"include"
)
set(priv_requires
"esp_driver_gptimer"
"esp_hal_usb"
"esp_driver_usb_serial_jtag"
"esp_timer"
)
set(priv_includes "")
set(requires "app_trace")
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${includes}
PRIV_INCLUDE_DIRS ${priv_includes}
PRIV_REQUIRES ${priv_requires}
REQUIRES ${requires}
WHOLE_ARCHIVE TRUE
LDFRAGMENTS linker.lf)
if(CONFIG_ESP_TRACE_OPTIMIZE_SPEED)
target_compile_options(${COMPONENT_LIB} PRIVATE -O2)
endif()