--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,8 +39,8 @@ SET(hiredis_sources ${hiredis_sources})
 IF(WIN32)
     ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN)
 ENDIF()
-
-ADD_LIBRARY(hiredis SHARED ${hiredis_sources})
+SET(CMAKE_C_STANDARD 99)
+ADD_LIBRARY(hiredis ${hiredis_sources})
 
 SET_TARGET_PROPERTIES(hiredis
     PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
@@ -97,7 +97,7 @@ IF(ENABLE_SSL)
     FIND_PACKAGE(OpenSSL REQUIRED)
     SET(hiredis_ssl_sources 
         ssl.c)
-    ADD_LIBRARY(hiredis_ssl SHARED
+    ADD_LIBRARY(hiredis_ssl
             ${hiredis_ssl_sources})
 
     IF (APPLE)
@@ -109,8 +109,7 @@ IF(ENABLE_SSL)
         WINDOWS_EXPORT_ALL_SYMBOLS TRUE
         VERSION "${HIREDIS_SONAME}")
 
-    TARGET_INCLUDE_DIRECTORIES(hiredis_ssl PRIVATE "${OPENSSL_INCLUDE_DIR}")
-    TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE ${OPENSSL_LIBRARIES})
+    TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE OpenSSL::SSL)
     IF (WIN32 OR MINGW)
         TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE hiredis)
     ENDIF()
