aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLong Nguyen <nguyen.long.908132@gmail.com>2020-08-02 11:22:54 +0700
committerGitHub <noreply@github.com>2020-08-01 21:22:54 -0700
commitc0f23c6c31ea7af5a751ea48a043dc64a872f4a0 (patch)
tree7af40a450e350538a66deb2bc6d8f1d76566fbf1
parentb46242ff15f78a2da58548bda04850daf3ddca48 (diff)
downloadvcpkg-c0f23c6c31ea7af5a751ea48a043dc64a872f4a0.tar.gz
vcpkg-c0f23c6c31ea7af5a751ea48a043dc64a872f4a0.zip
[openssl-unix] Add mingw with dynamic libs support - take 2 (#12544)
* [openssl-unix] Add mingw with dynamic libs support * Use new Port-Version Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Fix indenting Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
-rw-r--r--ports/openssl-unix/CMakeLists.txt23
-rw-r--r--ports/openssl-unix/CONTROL1
-rw-r--r--ports/openssl-unix/portfile.cmake4
3 files changed, 27 insertions, 1 deletions
diff --git a/ports/openssl-unix/CMakeLists.txt b/ports/openssl-unix/CMakeLists.txt
index 7857058f0..c7d7cc32a 100644
--- a/ports/openssl-unix/CMakeLists.txt
+++ b/ports/openssl-unix/CMakeLists.txt
@@ -15,6 +15,12 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(PLATFORM darwin64-x86_64-cc)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(PLATFORM BSD-generic64)
+elseif(MINGW)
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(PLATFORM mingw64)
+ else()
+ set(PLATFORM mingw)
+ endif()
else()
message(FATAL_ERROR "Unknown platform")
endif()
@@ -76,10 +82,15 @@ if(BUILD_SHARED_LIBS)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(LIB_EXT dylib)
set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT})
+ elseif(MINGW)
+ string(REPLACE "." "_" SHLIB_VERSION "${SHLIB_VERSION}")
+ set(BIN_EXT dll)
+ set(LIB_EXT dll.a)
else()
set(LIB_EXT so)
set(LIB_EXTS ${LIB_EXT}.${SHLIB_VERSION})
endif()
+ list(APPEND BIN_EXTS ${BIN_EXT})
list(APPEND LIB_EXTS ${LIB_EXT})
else()
set(SHARED no-shared)
@@ -89,6 +100,14 @@ foreach(lib ssl crypto)
foreach(ext ${LIB_EXTS})
list(APPEND INSTALL_LIBS "${BUILDDIR}/lib${lib}.${ext}")
endforeach()
+ foreach(ext ${BIN_EXTS})
+ # This might be wrong for targets which don't follow this naming scheme, but I'm not aware of any
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}-x64.${ext}")
+ else()
+ list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}.${ext}")
+ endif()
+ endforeach()
endforeach()
if(CMAKE_HOST_WIN32)
@@ -142,3 +161,7 @@ install(
FILES ${INSTALL_LIBS}
DESTINATION lib
)
+install(
+ FILES ${INSTALL_BINS}
+ DESTINATION bin
+) \ No newline at end of file
diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL
index a28775cc2..01fa5f3f6 100644
--- a/ports/openssl-unix/CONTROL
+++ b/ports/openssl-unix/CONTROL
@@ -1,4 +1,5 @@
Source: openssl-unix
Version: 1.1.1g
+Port-Version: 1
Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.
Supports: !(windows|uwp)
diff --git a/ports/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake
index 633cef70d..5dd28a6f2 100644
--- a/ports/openssl-unix/portfile.cmake
+++ b/ports/openssl-unix/portfile.cmake
@@ -1,4 +1,6 @@
-vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows")
+if (NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows")
+endif()
if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h")
message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl")