From 0c34c42043caf698ee2eee8b7bf631639ebf1181 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 17 Mar 2020 18:03:06 +0100 Subject: [PATCH] [cmake] fix build with external mbedTLS (#4696) `mbedcrypto` target is only available when `OT_BUILTIN_MBEDTLS` is set, therefore linking it unconditionally when external mbed TLS instance is used results in a linking error. Signed-off-by: Robert Lubos --- src/core/CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 36281395a..bd4537d31 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -233,12 +233,14 @@ target_sources(openthread-radio PRIVATE utils/parse_cmdline.cpp ) -target_link_libraries(openthread-ftd - PUBLIC - mbedcrypto -) +if(OT_BUILTIN_MBEDTLS) + target_link_libraries(openthread-ftd + PUBLIC + mbedcrypto + ) -target_link_libraries(openthread-mtd - PUBLIC - mbedcrypto -) + target_link_libraries(openthread-mtd + PUBLIC + mbedcrypto + ) +endif()