2024-04-08 08:08:23 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2023-11-22 04:27:43 -05:00
|
|
|
set(srcs)
|
|
|
|
set(public_include "include")
|
|
|
|
if(CONFIG_SOC_UART_SUPPORTED)
|
|
|
|
list(APPEND srcs "src/uart.c")
|
|
|
|
endif()
|
|
|
|
|
2024-04-08 08:08:23 -04:00
|
|
|
if(${target} STREQUAL "linux")
|
|
|
|
set(priv_requires esp_ringbuf)
|
|
|
|
else()
|
|
|
|
set(priv_requires esp_pm esp_driver_gpio esp_ringbuf)
|
|
|
|
endif()
|
|
|
|
|
2024-02-25 22:29:46 -05:00
|
|
|
idf_component_register(
|
|
|
|
SRCS ${srcs}
|
|
|
|
INCLUDE_DIRS ${public_include}
|
2024-04-08 08:08:23 -04:00
|
|
|
PRIV_REQUIRES "${priv_requires}"
|
2024-02-25 22:29:46 -05:00
|
|
|
LDFRAGMENTS "linker.lf"
|
|
|
|
)
|
2023-11-24 01:56:08 -05:00
|
|
|
|
2024-02-25 22:29:46 -05:00
|
|
|
if(CONFIG_VFS_SUPPORT_IO AND CONFIG_SOC_UART_SUPPORTED)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC idf::vfs)
|
|
|
|
target_sources(${COMPONENT_LIB} PRIVATE "src/uart_vfs.c")
|
|
|
|
if(CONFIG_ESP_CONSOLE_UART)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u uart_vfs_include_dev_init")
|
|
|
|
endif()
|
2023-11-24 01:56:08 -05:00
|
|
|
endif()
|