From 624725d6e0f5d4557f3dbbb8f3c7597b17698163 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 28 Mar 2019 16:29:13 +0800 Subject: [PATCH] coap: define WITH_POSIX in coap_config.h instead of globally --- components/coap/CMakeLists.txt | 5 ----- components/coap/Makefile.projbuild | 1 - components/coap/port/include/coap_config.h | 7 +++++-- 3 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 components/coap/Makefile.projbuild diff --git a/components/coap/CMakeLists.txt b/components/coap/CMakeLists.txt index 45788001c..1ec70b499 100644 --- a/components/coap/CMakeLists.txt +++ b/components/coap/CMakeLists.txt @@ -24,10 +24,5 @@ set(COMPONENT_REQUIRES lwip) register_component() -# Needed for coap headers in public builds, also. -# -# TODO: find a way to move this to a port header -target_compile_definitions(${COMPONENT_TARGET} PUBLIC WITH_POSIX) - # Silence format truncation warning, until it is fixed upstream set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation) diff --git a/components/coap/Makefile.projbuild b/components/coap/Makefile.projbuild deleted file mode 100644 index e900b0f9a..000000000 --- a/components/coap/Makefile.projbuild +++ /dev/null @@ -1 +0,0 @@ -CPPFLAGS += -DWITH_POSIX diff --git a/components/coap/port/include/coap_config.h b/components/coap/port/include/coap_config.h index db314f2de..1efa37aa7 100644 --- a/components/coap/port/include/coap_config.h +++ b/components/coap/port/include/coap_config.h @@ -18,10 +18,13 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ -#ifdef WITH_POSIX -#include "coap_config_posix.h" +/* Always enabled in ESP-IDF */ +#ifndef WITH_POSIX +#define WITH_POSIX #endif +#include "coap_config_posix.h" + #define HAVE_STDIO_H #define HAVE_ASSERT_H