Skip to content

Commit

Permalink
fix(linux_target): fix esp_err_to_name failing to compile on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ESP-Marius committed Feb 27, 2024
1 parent b39f13d commit 3c9463b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/esp_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ foreach(req ${optional_reqs})
target_link_libraries(${COMPONENT_LIB} PRIVATE ${req_lib})
endif()
endforeach()

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()

0 comments on commit 3c9463b

Please sign in to comment.