1# Only add the source/header files if the Tracerecorder is enables. By doing
2# this we avoid having a lot of conditional checks for configuration
3# options in the configuration files that use parameters from the KConfig,
4# parameters that are missing when the Tracerecorder is disabled.
5if(CONFIG_PERCEPIO_TRACERECORDER_ENABLED)
6	set(src_dirs "." "streamports/ESP_IDF_APPTRACE")
7	set(inc_dirs "config" "include" "streamports/ESP_IDF_APPTRACE/include")
8else()
9	set(src_dirs "")
10	set(inc_dirs "")
11endif()
12
13idf_component_register(SRC_DIRS "${src_dirs}"
14                    INCLUDE_DIRS "${inc_dirs}"
15                    LDFRAGMENTS "lifra.fr")
16
17# Since we inject Trace Recorder in the ESP-IDF we must expose the includes to ESP-IDF.
18if(CONFIG_PERCEPIO_TRACERECORDER_ENABLED)
19idf_build_set_property(INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/config APPEND)
20idf_build_set_property(INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/include APPEND)
21idf_build_set_property(INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/streamports/ESP_IDF_APPTRACE/include APPEND)
22endif()