2019-08-08 00:00:45 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2021-07-08 12:11:33 -04:00
|
|
|
if(${target} STREQUAL "linux")
|
2022-08-15 17:24:21 -04:00
|
|
|
set(ldfragments)
|
|
|
|
set(srcs "src/esp_err_check_linux.c")
|
|
|
|
else()
|
|
|
|
set(ldfragments common.lf soc.lf)
|
|
|
|
set(srcs)
|
2021-07-08 12:11:33 -04:00
|
|
|
endif()
|
|
|
|
|
2021-01-20 02:18:55 -05:00
|
|
|
list(APPEND srcs "src/esp_err_to_name.c")
|
|
|
|
|
|
|
|
# Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
|
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
INCLUDE_DIRS include
|
2022-08-15 17:24:21 -04:00
|
|
|
LDFRAGMENTS ${ldfragments})
|
2021-01-20 02:18:55 -05:00
|
|
|
|
|
|
|
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)
|
|
|
|
|
|
|
|
# List of components needed for the error codes list
|
|
|
|
set(optional_reqs ulp
|
|
|
|
efuse
|
|
|
|
esp_http_client
|
|
|
|
esp_http_server
|
|
|
|
bootloader_support
|
|
|
|
nvs_flash
|
|
|
|
esp_wifi
|
|
|
|
app_update
|
|
|
|
lwip
|
|
|
|
spi_flash
|
|
|
|
wpa_supplicant
|
|
|
|
esp_serial_slave_link
|
|
|
|
esp_netif
|
|
|
|
soc
|
|
|
|
esp-tls
|
2021-09-06 04:22:40 -04:00
|
|
|
esp_https_ota
|
|
|
|
esp_hw_support)
|
2021-01-20 02:18:55 -05:00
|
|
|
|
|
|
|
idf_build_get_property(build_components BUILD_COMPONENTS)
|
|
|
|
foreach(req ${optional_reqs})
|
|
|
|
if(req IN_LIST build_components)
|
|
|
|
idf_component_get_property(req_lib ${req} COMPONENT_LIB)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PRIVATE ${req_lib})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2024-02-27 03:50:59 -05:00
|
|
|
|
|
|
|
if(${IDF_TARGET} STREQUAL "linux" AND CONFIG_ESP_ERR_TO_NAME_LOOKUP)
|
|
|
|
find_library(LIB_BSD bsd)
|
|
|
|
if(LIB_BSD)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PRIVATE ${LIB_BSD})
|
|
|
|
elseif(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
message(WARNING "Missing LIBBSD library. Install libbsd-dev package and/or check linker directories.")
|
|
|
|
endif()
|
|
|
|
endif()
|