diff options
author | Satoshi Yasushima <yasushima-gd@users.noreply.github.com> | 2016-08-25 18:17:12 +0900 |
---|---|---|
committer | Satoshi Yasushima <yasushima-gd@users.noreply.github.com> | 2016-08-25 18:17:12 +0900 |
commit | 971892766db26560f7cc34b78750cac149867425 (patch) | |
tree | 0f79d8a26a3519d48c25cac77d2b71faf5c33fc5 | |
parent | 8edd509e2c42219ec1104913e6597332b9e5f2e9 (diff) | |
download | portable-971892766db26560f7cc34b78750cac149867425.tar.gz portable-971892766db26560f7cc34b78750cac149867425.tar.bz2 portable-971892766db26560f7cc34b78750cac149867425.zip |
build MinGW on CMake
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 2 | ||||
-rw-r--r-- | ssl/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tls/CMakeLists.txt | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f0e074a..f4300dd 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) |
50 | endif() | 50 | endif() |
51 | 51 | ||
52 | if(MSVC) | 52 | if(WIN32) |
53 | set(BUILD_NC false) | 53 | set(BUILD_NC false) |
54 | endif() | 54 | endif() |
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) |
81 | endif() | 81 | endif() |
82 | 82 | ||
83 | if(MSVC) | 83 | if(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) |
90 | endif() | ||
91 | |||
92 | if(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) |
144 | endif() | 147 | endif() |
145 | 148 | ||
146 | if(MSVC) | 149 | if(WIN32) |
147 | set(HAVE_STRNLEN true) | 150 | set(HAVE_STRNLEN true) |
148 | add_definitions(-DHAVE_STRNLEN) | 151 | add_definitions(-DHAVE_STRNLEN) |
149 | else() | 152 | else() |
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 681c929..e41ac58 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -752,7 +752,7 @@ 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 | endif() | 757 | endif() |
758 | set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto) | 758 | set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto) |
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index e836047..7f53e14 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt | |||
@@ -52,7 +52,7 @@ 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 | endif() | 57 | endif() |
58 | set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl) | 58 | set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl) |
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index b8549a6..df5c790 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt | |||
@@ -31,7 +31,7 @@ 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 | endif() | 36 | endif() |
37 | set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls) | 37 | set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls) |