mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
refactor(linux): Unified libbsd handling
* Users can now use libbsd string.h and sys/cdefs.h functionality (e.g., strlcpy, containerof) on Linux by just including string.h or sys/cdefs.h. In other words, the includes are the same on the Linux target as well as on chips targets (ESP32, etc.). * libbsd linking is done by the linux component (belongs to common components) now instead of handling it separately in each component
This commit is contained in:
@@ -30,13 +30,6 @@ if(${target} STREQUAL "linux")
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC "-DLINUX_TARGET")
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC --coverage)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC --coverage)
|
||||
|
||||
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()
|
||||
else()
|
||||
target_sources(${COMPONENT_LIB} PRIVATE "src/nvs_encrypted_partition.cpp")
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::mbedtls)
|
||||
|
||||
Reference in New Issue
Block a user