From 907b1a90326a7768a3baa256080d1842dd25817d Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Thu, 8 Nov 2018 11:26:33 +0530 Subject: [PATCH] mbedtls: align CMake build with corresponding component.mk --- components/heap/CMakeLists.txt | 2 +- components/mbedtls/CMakeLists.txt | 7 ++++++- components/pthread/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/heap/CMakeLists.txt b/components/heap/CMakeLists.txt index c2ff4d50a6..442a9676f1 100644 --- a/components/heap/CMakeLists.txt +++ b/components/heap/CMakeLists.txt @@ -30,7 +30,7 @@ if(CONFIG_HEAP_TRACING) heap_caps_realloc_default) foreach(wrap ${WRAP_FUNCTIONS}) - target_link_libraries(heap "-Wl,--wrap=${wrap}") + target_link_libraries(${COMPONENT_TARGET} "-Wl,--wrap=${wrap}") endforeach() endif() diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index c99985d1c8..e9cd58153b 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -21,6 +21,11 @@ include_directories("${COMPONENT_PATH}/port/include") # Import mbedtls library targets add_subdirectory(mbedtls) +# Use port specific implementation of net_socket.c instead of one from mbedtls +get_target_property(src_tls mbedtls SOURCES) +list(REMOVE_ITEM src_tls net_sockets.c) +set_property(TARGET mbedtls PROPERTY SOURCES ${src_tls}) + set(mbedtls_targets mbedtls mbedcrypto mbedx509) # Add port files to mbedtls targets @@ -54,4 +59,4 @@ target_link_libraries(${COMPONENT_TARGET} ${mbedtls_targets}) # Catch usage of deprecated mbedTLS functions when building tests if(mbedtls_test IN_LIST BUILD_TEST_COMPONENTS) add_definitions(-DMBEDTLS_DEPRECATED_WARNING) -endif() \ No newline at end of file +endif() diff --git a/components/pthread/CMakeLists.txt b/components/pthread/CMakeLists.txt index 157793707f..d793a12e32 100644 --- a/components/pthread/CMakeLists.txt +++ b/components/pthread/CMakeLists.txt @@ -6,5 +6,5 @@ set(COMPONENT_REQUIRES) register_component() if(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) - target_link_libraries(pthread "-Wl,--wrap=vPortCleanUpTCB") + target_link_libraries(${COMPONENT_TARGET} "-Wl,--wrap=vPortCleanUpTCB") endif()