summaryrefslogtreecommitdiff
path: root/infrastructure/cmake/windows/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2017-06-03 12:13:42 +0100
committerChris Wilson <chris+github@qwirx.com>2018-01-01 16:24:32 +0000
commit85e7efc3fa0477f60318d2cd2144503a9ea8feb9 (patch)
tree237b161707ed2b45b07a455f0089f23c6ecc1dd3 /infrastructure/cmake/windows/CMakeLists.txt
parent3db0438644b10370293d9b2f3bd8457561e2c9f8 (diff)
Add support for OpenSSL 1.1 and replace deprecated function calls
See https://github.com/boxbackup/boxbackup/issues/16 for details. Thanks to Chris West @FauxFaux for the initial patch! Use OpenSSL 1.1.0g for Windows superbuild. Fix Windows build by removing calls to obsolete do_ms.bat <https://stackoverflow.com/questions/39076244/why-there-is-no-ms-do-ms-bat-after-perl-configure-vc-win64a/39247560#39247560>. Workaround for incorrect library suffixes searched by FindOpenSSL <https://gitlab.kitware.com/cmake/cmake/issues/17604>. Link OpenSSL statically and fix missing dependency on crypt32.lib. (cherry picked from commit edd3687f067c68b131822e0064cdeff5bf7a3835) (cherry picked from commit b003e009d1fccadf55a0f59a01c66f7b80f9b3e5) (cherry picked from commit cc6e20466b857f7e20d816a2c20cb36f112398ab) (cherry picked from commit 303c6405e3bc1e673dbc691792e0633742c01f4e) (cherry picked from commit 4e24006f75142a254f1a7db76cf9da1e752d9283) (cherry picked from commit 448ac48a89538f67f508f8d21931c5e6e90472c0) (cherry picked from commit 00b3bb0697219ef8c742698dd43d53b538e362b1)
Diffstat (limited to 'infrastructure/cmake/windows/CMakeLists.txt')
-rw-r--r--infrastructure/cmake/windows/CMakeLists.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/infrastructure/cmake/windows/CMakeLists.txt b/infrastructure/cmake/windows/CMakeLists.txt
index 0fbe35e3..49a1ea4d 100644
--- a/infrastructure/cmake/windows/CMakeLists.txt
+++ b/infrastructure/cmake/windows/CMakeLists.txt
@@ -15,9 +15,9 @@ set(ZLIB_VERSION 1.2.11)
set(ZLIB_HASH SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1)
# Version of OpenSSL to download, build, and compile Box Backup against:
-set(OPENSSL_VERSION 1.0.2j)
+set(OPENSSL_VERSION 1.1.0g)
# Hash of openssl-${OPENSSL_VERSION}.tar.gz, to be verified after download:
-set(OPENSSL_HASH SHA256=e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431)
+set(OPENSSL_HASH SHA256=de4d501267da39310905cb6dc8c6121f7a2cad45a7707f76df828fe1b85073af)
# Version of PCRE to download, build, and compile Box Backup against:
set(PCRE_VERSION 8.39)
@@ -49,15 +49,21 @@ if(WIN32)
URL "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
URL_HASH ${OPENSSL_HASH}
DOWNLOAD_NO_PROGRESS 1
- CONFIGURE_COMMAND perl Configure debug-VC-WIN32 no-asm --prefix=${install_dir}
- COMMAND cmd /c ms\\do_ms.bat
+ CONFIGURE_COMMAND perl Configure debug-VC-WIN32 no-asm no-shared
+ --prefix=${install_dir}
+ --openssldir=etc
+ # Run tests before install, but don't make the main target depend on them, so that
+ # we don't have to run them whenever we build manually on Windows.
+ TEST_BEFORE_INSTALL 1
+ TEST_EXCLUDE_FROM_MAIN 1
# You would expect us to use nt.mak to compile a static library here, but mk1mf.pl uses the /MT[d]
# CRT in that case, which is incompatible with our dynamic runtime, /MD[d]. It seems that the libs
# built by ntdll.mak, which are compiled with /MD[d], are full libraries and not import libs,
# so we can link statically against them and still get a dynamic runtime.
BUILD_IN_SOURCE 1
- BUILD_COMMAND nmake /s /f ms\\nt.mak
- INSTALL_COMMAND nmake /s /f ms\\nt.mak install
+ BUILD_COMMAND nmake /s
+ TEST_COMMAND nmake /s test
+ INSTALL_COMMAND nmake /s install
)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ExternalProject_Add(openssl