From d6917f0eb338b083b70fafd3f8d19ca4af58b71e Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Mon, 9 Jun 2014 23:46:41 +0200
Subject: [PATCH] Add LINK_WITH_PTHREAD to CMakeList for explicitly adding
pthread linking
---
library/CMakeLists.txt | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 4cbd1629e..2e202de78 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -1,5 +1,6 @@
option(USE_STATIC_POLARSSL_LIBRARY "Build PolarSSL static library." ON)
option(USE_SHARED_POLARSSL_LIBRARY "Build PolarSSL shared library." OFF)
+option(LINK_WITH_PTHREAD "Explicitly link PolarSSL library to pthread." OFF)
set(src
aes.c
@@ -102,6 +103,9 @@ if(USE_STATIC_POLARSSL_LIBRARY)
target_link_libraries(${polarssl_static_target} ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND)
+ if(LINK_WITH_PTHREAD)
+ target_link_libraries(${polarssl_static_target} pthread)
+ endif()
install(TARGETS ${polarssl_static_target}
DESTINATION ${LIB_INSTALL_DIR}
@@ -118,6 +122,10 @@ if(USE_SHARED_POLARSSL_LIBRARY)
target_link_libraries(polarssl ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND)
+ if(LINK_WITH_PTHREAD)
+ target_link_libraries(polarssl pthread)
+ endif()
+
install(TARGETS polarssl
DESTINATION ${LIB_INSTALL_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)