aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt13
-rw-r--r--crypto/CMakeLists.txt6
-rw-r--r--ssl/CMakeLists.txt6
-rw-r--r--tls/CMakeLists.txt6
4 files changed, 20 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0e074a..e546ea4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,7 +49,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "MINGW")
49 set(BUILD_NC false) 49 set(BUILD_NC false)
50endif() 50endif()
51 51
52if(MSVC) 52if(WIN32)
53 set(BUILD_NC false) 53 set(BUILD_NC false)
54endif() 54endif()
55 55
@@ -80,14 +80,17 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
80 add_definitions(-Wno-pointer-sign) 80 add_definitions(-Wno-pointer-sign)
81endif() 81endif()
82 82
83if(MSVC) 83if(WIN32)
84 add_definitions(-Dinline=__inline)
85 add_definitions(-Drestrict) 84 add_definitions(-Drestrict)
86 add_definitions(-D_CRT_SECURE_NO_WARNINGS) 85 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
87 add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS) 86 add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS)
88 add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS) 87 add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS)
89 add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0501) 88 add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0501)
90 add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT) 89 add_definitions(-DCPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG -DNO_CRYPT)
90endif()
91
92if(MSVC)
93 add_definitions(-Dinline=__inline)
91 94
92 set(MSVC_DISABLED_WARNINGS_LIST 95 set(MSVC_DISABLED_WARNINGS_LIST
93 "C4057" # C4057: 'initializing' : 'unsigned char *' differs in 96 "C4057" # C4057: 'initializing' : 'unsigned char *' differs in
@@ -143,7 +146,7 @@ if(HAVE_STRNDUP)
143 add_definitions(-DHAVE_STRNDUP) 146 add_definitions(-DHAVE_STRNDUP)
144endif() 147endif()
145 148
146if(MSVC) 149if(WIN32)
147 set(HAVE_STRNLEN true) 150 set(HAVE_STRNLEN true)
148 add_definitions(-DHAVE_STRNLEN) 151 add_definitions(-DHAVE_STRNLEN)
149else() 152else()
@@ -237,7 +240,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
237 set(OPENSSL_LIBS ${OPENSSL_LIBS} nsl socket) 240 set(OPENSSL_LIBS ${OPENSSL_LIBS} nsl socket)
238endif() 241endif()
239 242
240if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|MINGW|CYGWIN)" OR MSVC)) 243if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|CYGWIN)"))
241 set(BUILD_SHARED true) 244 set(BUILD_SHARED true)
242endif() 245endif()
243 246
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 681c929..d8453f3 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -752,10 +752,12 @@ if (BUILD_SHARED)
752 add_library(crypto-objects OBJECT ${CRYPTO_SRC}) 752 add_library(crypto-objects OBJECT ${CRYPTO_SRC})
753 add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>) 753 add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>)
754 add_library(crypto-shared SHARED $<TARGET_OBJECTS:crypto-objects>) 754 add_library(crypto-shared SHARED $<TARGET_OBJECTS:crypto-objects>)
755 if (MSVC) 755 if (WIN32)
756 target_link_libraries(crypto-shared crypto Ws2_32.lib) 756 target_link_libraries(crypto-shared crypto Ws2_32.lib)
757 set(CRYPTO_POSTFIX -${CRYPTO_MAJOR_VERSION})
757 endif() 758 endif()
758 set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto) 759 set_target_properties(crypto-shared PROPERTIES
760 OUTPUT_NAME crypto${CRYPTO_POSTFIX} ARCHIVE_OUTPUT_NAME crypto)
759 set_target_properties(crypto-shared PROPERTIES VERSION 761 set_target_properties(crypto-shared PROPERTIES VERSION
760 ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION}) 762 ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})
761 install(TARGETS crypto crypto-shared DESTINATION lib) 763 install(TARGETS crypto crypto-shared DESTINATION lib)
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt
index e836047..0aac799 100644
--- a/ssl/CMakeLists.txt
+++ b/ssl/CMakeLists.txt
@@ -52,10 +52,12 @@ if (BUILD_SHARED)
52 add_library(ssl-objects OBJECT ${SSL_SRC}) 52 add_library(ssl-objects OBJECT ${SSL_SRC})
53 add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>) 53 add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>)
54 add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>) 54 add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>)
55 if (MSVC) 55 if (WIN32)
56 target_link_libraries(ssl-shared crypto-shared Ws2_32.lib) 56 target_link_libraries(ssl-shared crypto-shared Ws2_32.lib)
57 set(SSL_POSTFIX -${SSL_MAJOR_VERSION})
57 endif() 58 endif()
58 set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl) 59 set_target_properties(ssl-shared PROPERTIES
60 OUTPUT_NAME ssl${SSL_POSTFIX} ARCHIVE_OUTPUT_NAME ssl)
59 set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} 61 set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION}
60 SOVERSION ${SSL_MAJOR_VERSION}) 62 SOVERSION ${SSL_MAJOR_VERSION})
61 install(TARGETS ssl ssl-shared DESTINATION lib) 63 install(TARGETS ssl ssl-shared DESTINATION lib)
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt
index b8549a6..54ae953 100644
--- a/tls/CMakeLists.txt
+++ b/tls/CMakeLists.txt
@@ -31,10 +31,12 @@ if (BUILD_SHARED)
31 add_library(tls-objects OBJECT ${TLS_SRC}) 31 add_library(tls-objects OBJECT ${TLS_SRC})
32 add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>) 32 add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>)
33 add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>) 33 add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>)
34 if (MSVC) 34 if (WIN32)
35 target_link_libraries(tls-shared ssl-shared crypto-shared Ws2_32.lib) 35 target_link_libraries(tls-shared ssl-shared crypto-shared Ws2_32.lib)
36 set(TLS_POSTFIX -${TLS_MAJOR_VERSION})
36 endif() 37 endif()
37 set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls) 38 set_target_properties(tls-shared PROPERTIES
39 OUTPUT_NAME tls${TLS_POSTFIX} ARCHIVE_OUTPUT_NAME tls)
38 set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} 40 set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION}
39 SOVERSION ${TLS_MAJOR_VERSION}) 41 SOVERSION ${TLS_MAJOR_VERSION})
40 install(TARGETS tls tls-shared DESTINATION lib) 42 install(TARGETS tls tls-shared DESTINATION lib)