Make OPENSSL_USE_STATIC_LIBS requirement conditional on build type
Update CMake configuration of openssl_posix target to link against libssl.a when building as a shared library; otherwise, link against libssl.o. This is done to avoid issues when linking static library of OpenSSL when building openssl_posix as a shared library
@@ -26,7 +26,11 @@ target_link_libraries( plaintext_posix
add_library( openssl_posix
${OPENSSL_TRANSPORT_SOURCES} )
+# For static library builds, link against static library of OpenSSL
+# for openssl_posix target.
+if(NOT BUILD_SHARED_LIBS)
set( OPENSSL_USE_STATIC_LIBS TRUE )
+endif()
find_package( OpenSSL REQUIRED )
# Verify the minimum OpenSSL version required
