1idf_build_get_property(target IDF_TARGET)
2set(srcs "log.c" "log_buffers.c")
3set(priv_requires "")
4if(${target} STREQUAL "linux")
5    list(APPEND srcs "log_linux.c")
6else()
7    list(APPEND priv_requires soc hal esp_hw_support)
8endif()
9
10idf_component_register(SRCS ${srcs}
11                    INCLUDE_DIRS "include"
12                    LDFRAGMENTS linker.lf
13                    PRIV_REQUIRES ${priv_requires})
14
15if(NOT ${target} STREQUAL "linux")
16    # Ideally, FreeRTOS shouldn't be included into bootloader build, so the 2nd check should be unnecessary
17    if(freertos IN_LIST BUILD_COMPONENTS AND NOT BOOTLOADER_BUILD)
18        target_sources(${COMPONENT_TARGET} PRIVATE log_freertos.c)
19    else()
20        target_sources(${COMPONENT_TARGET} PRIVATE log_noos.c)
21    endif()
22endif()
23