From ae15f1c4f95cae0ce88a436ce62896d44cc18ff8 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Tue, 30 Jul 2024 16:41:28 +0200 Subject: [PATCH] refactor(linux): deprecated esp_linux_helper.h --- components/linux/CMakeLists.txt | 12 +++++------- components/linux/include/esp_linux_helper.h | 6 +----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/components/linux/CMakeLists.txt b/components/linux/CMakeLists.txt index 7d044d860e..e446de0e9d 100644 --- a/components/linux/CMakeLists.txt +++ b/components/linux/CMakeLists.txt @@ -15,11 +15,9 @@ idf_component_register(INCLUDE_DIRS ${includes} REQUIRED_IDF_TARGETS linux SRCS ${srcs}) -if(${IDF_TARGET} STREQUAL "linux") - 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() +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() diff --git a/components/linux/include/esp_linux_helper.h b/components/linux/include/esp_linux_helper.h index 3ffb4417e0..d69da455c6 100644 --- a/components/linux/include/esp_linux_helper.h +++ b/components/linux/include/esp_linux_helper.h @@ -5,11 +5,7 @@ */ #pragma once -/* - * NOTE: This file is deprecated and will be removed in the future. - * Use include sys/cdefs.h instead, it will also include - * the corresponding libbsd header. TODO: IDF-9391 - */ +#warning "This file is deprecated, as __containerof is available via libbsd. To use __containerof, include string.h." #ifdef __cplusplus extern "C" {