2021-05-13 05:04:31 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
2022-04-10 13:52:06 -04:00
|
|
|
set(srcs "log.c" "log_buffers.c")
|
2021-06-02 23:59:00 -04:00
|
|
|
set(priv_requires "")
|
2021-05-13 05:04:31 -04:00
|
|
|
if(${target} STREQUAL "linux")
|
|
|
|
list(APPEND srcs "log_linux.c")
|
|
|
|
else()
|
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()
|