Skip to content

Commit 624725d

Browse files
committed
coap: define WITH_POSIX in coap_config.h instead of globally
1 parent 8016448 commit 624725d

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

components/coap/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,5 @@ set(COMPONENT_REQUIRES lwip)
2424

2525
register_component()
2626

27-
# Needed for coap headers in public builds, also.
28-
#
29-
# TODO: find a way to move this to a port header
30-
target_compile_definitions(${COMPONENT_TARGET} PUBLIC WITH_POSIX)
31-
3227
# Silence format truncation warning, until it is fixed upstream
3328
set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation)

components/coap/Makefile.projbuild

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/coap/port/include/coap_config.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
#ifndef _CONFIG_H_
1919
#define _CONFIG_H_
2020

21-
#ifdef WITH_POSIX
22-
#include "coap_config_posix.h"
21+
/* Always enabled in ESP-IDF */
22+
#ifndef WITH_POSIX
23+
#define WITH_POSIX
2324
#endif
2425

26+
#include "coap_config_posix.h"
27+
2528
#define HAVE_STDIO_H
2629
#define HAVE_ASSERT_H
2730

0 commit comments

Comments
 (0)