From 183264cb951bbf089bfccf15b374661a944ff29f Mon Sep 17 00:00:00 2001 From: Ron Eldor Date: Mon, 9 Oct 2017 19:07:26 +0300 Subject: [PATCH] Fix shared library link error with cmake on Windows Set the library path as the current binary dir Signed-off-by: Tom Cosgrove --- ChangeLog.d/fix-windows-cmake-build-with-shared-libraries.txt | 3 +++ library/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+) create mode 100644 ChangeLog.d/fix-windows-cmake-build-with-shared-libraries.txt diff --git a/ChangeLog.d/fix-windows-cmake-build-with-shared-libraries.txt b/ChangeLog.d/fix-windows-cmake-build-with-shared-libraries.txt new file mode 100644 index 000000000..687864523 --- /dev/null +++ b/ChangeLog.d/fix-windows-cmake-build-with-shared-libraries.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix compilation on Windows when building shared library, by setting + library search path to CMAKE_CURRENT_BINARY_DIR. diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index ddede0390..914f98eaa 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -259,6 +259,7 @@ if(USE_STATIC_MBEDTLS_LIBRARY) endif(USE_STATIC_MBEDTLS_LIBRARY) if(USE_SHARED_MBEDTLS_LIBRARY) + set(CMAKE_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}) add_library(${mbedcrypto_target} SHARED ${src_crypto}) set_target_properties(${mbedcrypto_target} PROPERTIES VERSION 3.1.0 SOVERSION 11) target_link_libraries(${mbedcrypto_target} PUBLIC ${libs})