2021-05-13 05:04:31 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
set(srcs "log.c")
|
2021-06-02 23:59:00 -04:00
|
|
|
set(priv_requires "")
|
2021-05-13 05:04:31 -04:00
|
|
|
if(${target} STREQUAL "linux")
|
2021-08-11 03:22:50 -04:00
|
|
|
# We leave log buffers out for now on Linux since it's rarely used. Explicitely add esp_rom to Linux target
|
2021-06-02 23:59:00 -04:00
|
|
|
# since we don't have the common components there yet.
|
2021-05-13 05:04:31 -04:00
|
|
|
list(APPEND srcs "log_linux.c")
|
|
|
|
else()
|
|
|
|
list(APPEND srcs "log_buffers.c")
|
2022-03-31 03:07:51 -04:00
|
|
|
list(APPEND priv_requires soc hal esp_hw_support)
|
2021-05-13 05:04:31 -04:00
|
|
|
endif()
|
2019-11-21 12:40:59 -05:00
|
|
|
|
|
|
|
idf_component_register(SRCS ${srcs}
|
2019-04-28 03:38:23 -04:00
|
|
|
INCLUDE_DIRS "include"
|
2019-11-21 12:40:59 -05:00
|
|
|
LDFRAGMENTS linker.lf
|
2021-05-13 05:04:31 -04:00
|
|
|
PRIV_REQUIRES ${priv_requires})
|
2019-11-21 12:40:59 -05:00
|
|
|
|
2021-05-13 05:04:31 -04:00
|
|
|
if(NOT ${target} STREQUAL "linux")
|
|
|
|
# Ideally, FreeRTOS shouldn't be included into bootloader build, so the 2nd check should be unnecessary
|
|
|
|
if(freertos IN_LIST BUILD_COMPONENTS AND NOT BOOTLOADER_BUILD)
|
|
|
|
target_sources(${COMPONENT_TARGET} PRIVATE log_freertos.c)
|
|
|
|
else()
|
|
|
|
target_sources(${COMPONENT_TARGET} PRIVATE log_noos.c)
|
|
|
|
endif()
|
2019-11-21 12:40:59 -05:00
|
|
|
endif()
|