2021-05-13 09:04:31 +00:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
set(srcs "log.c")
|
2021-06-03 03:59:00 +00:00
|
|
|
set(priv_requires "")
|
2021-05-13 09:04:31 +00:00
|
|
|
if(${target} STREQUAL "linux")
|
2021-08-11 07:22:50 +00:00
|
|
|
# We leave log buffers out for now on Linux since it's rarely used. Explicitely add esp_rom to Linux target
|
2021-06-03 03:59:00 +00:00
|
|
|
# since we don't have the common components there yet.
|
2021-05-13 09:04:31 +00:00
|
|
|
list(APPEND srcs "log_linux.c")
|
|
|
|
else()
|
|
|
|
list(APPEND srcs "log_buffers.c")
|
|
|
|
list(APPEND priv_requires soc)
|
|
|
|
endif()
|
2019-11-21 17:40:59 +00:00
|
|
|
|
|
|
|
idf_component_register(SRCS ${srcs}
|
2019-04-28 07:38:23 +00:00
|
|
|
INCLUDE_DIRS "include"
|
2019-11-21 17:40:59 +00:00
|
|
|
LDFRAGMENTS linker.lf
|
2021-05-13 09:04:31 +00:00
|
|
|
PRIV_REQUIRES ${priv_requires})
|
2019-11-21 17:40:59 +00:00
|
|
|
|
2021-05-13 09:04:31 +00: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 17:40:59 +00:00
|
|
|
endif()
|