mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
feat(log): Refactoring buffer log APIs
This commit is contained in:
@@ -1,22 +1,27 @@
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
set(srcs "log.c" "log_buffers.c")
|
||||
|
||||
set(srcs "")
|
||||
set(priv_requires "")
|
||||
if(${target} STREQUAL "linux")
|
||||
list(APPEND srcs "log_linux.c")
|
||||
|
||||
if(BOOTLOADER_BUILD)
|
||||
list(APPEND srcs "log_noos.c")
|
||||
else()
|
||||
list(APPEND priv_requires soc hal esp_hw_support)
|
||||
list(APPEND srcs "log.c")
|
||||
|
||||
if(${target} STREQUAL "linux")
|
||||
list(APPEND srcs "log_linux.c")
|
||||
else()
|
||||
list(APPEND srcs "log_freertos.c")
|
||||
list(APPEND priv_requires soc hal esp_hw_support)
|
||||
endif()
|
||||
|
||||
# Buffer APIs call ESP_LOG_LEVEL -> esp_log_write, which can not used in bootloader.
|
||||
list(APPEND srcs "src/buffer/log_buffers.c"
|
||||
"src/util.c")
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS "include"
|
||||
PRIV_INCLUDE_DIRS "include/esp_private"
|
||||
LDFRAGMENTS linker.lf
|
||||
PRIV_REQUIRES ${priv_requires})
|
||||
|
||||
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()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user