|
1 |
| -set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2) |
| 1 | +if(CONFIG_ENABLE_COAP) |
| 2 | + set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2) |
2 | 3 |
|
3 |
| -set(srcs |
4 |
| - "libcoap/src/address.c" |
5 |
| - "libcoap/src/async.c" |
6 |
| - "libcoap/src/block.c" |
7 |
| - "libcoap/src/coap_event.c" |
8 |
| - "libcoap/src/coap_hashkey.c" |
9 |
| - "libcoap/src/coap_session.c" |
10 |
| - "libcoap/src/coap_time.c" |
11 |
| - "libcoap/src/coap_debug.c" |
12 |
| - "libcoap/src/encode.c" |
13 |
| - "libcoap/src/mem.c" |
14 |
| - "libcoap/src/net.c" |
15 |
| - "libcoap/src/option.c" |
16 |
| - "libcoap/src/pdu.c" |
17 |
| - "libcoap/src/resource.c" |
18 |
| - "libcoap/src/str.c" |
19 |
| - "libcoap/src/subscribe.c" |
20 |
| - "libcoap/src/uri.c" |
21 |
| - "libcoap/src/coap_notls.c" |
22 |
| - "port/coap_io.c") |
| 4 | + set(srcs |
| 5 | + "libcoap/src/address.c" |
| 6 | + "libcoap/src/async.c" |
| 7 | + "libcoap/src/block.c" |
| 8 | + "libcoap/src/coap_event.c" |
| 9 | + "libcoap/src/coap_hashkey.c" |
| 10 | + "libcoap/src/coap_session.c" |
| 11 | + "libcoap/src/coap_time.c" |
| 12 | + "libcoap/src/coap_debug.c" |
| 13 | + "libcoap/src/encode.c" |
| 14 | + "libcoap/src/mem.c" |
| 15 | + "libcoap/src/net.c" |
| 16 | + "libcoap/src/option.c" |
| 17 | + "libcoap/src/pdu.c" |
| 18 | + "libcoap/src/resource.c" |
| 19 | + "libcoap/src/str.c" |
| 20 | + "libcoap/src/subscribe.c" |
| 21 | + "libcoap/src/uri.c" |
| 22 | + "libcoap/src/coap_notls.c" |
| 23 | + "port/coap_io.c") |
23 | 24 |
|
24 |
| -set(COMPONENT_REQUIRES lwip) |
| 25 | + set(COMPONENT_REQUIRES lwip) |
25 | 26 |
|
26 |
| -idf_component_register(SRCS "${srcs}" |
| 27 | + idf_component_register(SRCS "${srcs}" |
27 | 28 | INCLUDE_DIRS "${include_dirs}"
|
28 | 29 | REQUIRES lwip)
|
29 | 30 |
|
30 |
| -# Silence format truncation warning, until it is fixed upstream |
31 |
| -set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation) |
| 31 | + # Silence format truncation warning, until it is fixed upstream |
| 32 | + set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation) |
32 | 33 |
|
33 |
| -# Needed for coap headers in public builds, also. |
34 |
| -# |
35 |
| -# TODO: find a way to move this to a port header |
36 |
| -target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX) |
| 34 | + # Needed for coap headers in public builds, also. |
| 35 | + # |
| 36 | + # TODO: find a way to move this to a port header |
| 37 | + target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX) |
| 38 | +else() |
| 39 | + register_component() |
| 40 | +endif() |
37 | 41 |
|
0 commit comments