-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (28 loc) · 1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
idf_build_get_property(target IDF_TARGET)
set( srcs "log.c" )
set( include_dirs "include" )
set( requires )
set( priv_requires )
if(${target} STREQUAL "linux")
# We leave log buffers out for now on Linux since it's rarely used. Explicitely add esp_rom to Linux target
# since we don't have the common components there yet.
list( APPEND srcs "log_linux.c" )
else()
list( APPEND srcs "log_buffers.c" )
list( APPEND priv_requires "hal_esp32 printfx soc stringsX" )
endif()
idf_component_register(
SRCS ${srcs}
INCLUDE_DIRS ${include_dirs}
LDFRAGMENTS linker.lf
REQUIRES ${requires}
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()