Add missing dependencies to "openthread-posix" target (#8801)

The `openthread-posix` library calls OT public APIs and library APIs
(e.g. radio_spinel, HDLC), but it doesn't link against the library
targets.

This commit also adds `extern "C"` for posix impl of `otPlatFree`
and `otPlatCAlloc`.
This commit is contained in:
Kangping
2023-02-24 10:52:39 -08:00
committed by GitHub
parent 57ed65edf4
commit f4f2d90d6a
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -135,6 +135,10 @@ target_link_libraries(openthread-posix
PUBLIC
openthread-platform
PRIVATE
openthread-cli-ftd
openthread-ftd
openthread-hdlc
openthread-spinel-rcp
openthread-url
ot-config-ftd
ot-config
+2
View File
@@ -34,7 +34,9 @@
#include <openthread/platform/memory.h>
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
extern "C" {
void *otPlatCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
void otPlatFree(void *aPtr) { free(aPtr); }
} // extern "C"
#endif