From 0901bb15a58aa46b2bbee41b5c8f1966ad7be1c2 Mon Sep 17 00:00:00 2001 From: dan-42 Date: Tue, 10 Aug 2021 20:54:40 +0200 Subject: [PATCH] Fix compilation on windows msvc and ninja --- .../OpenSSL/ep-stages/configure_1_1_plus.cmake.in | 14 ++++++++++++++ .../url_sha1_openssl_windows_1_1_plus.cmake.in | 1 + 2 files changed, 15 insertions(+) diff --git a/cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in b/cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in index d49e53327f..c91e31a680 100644 --- a/cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in +++ b/cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in @@ -12,6 +12,20 @@ if("@openssl_dir@" STREQUAL "") message(FATAL_ERROR "openssl_dir is empty") endif() +if("@MSVC@") + # Unset as we are already in a msvc environment + # and the openssl perl script will figure things out. + # The created variable content by CMake is unqouted and will cause issues + unset(ENV{CC}) + unset(ENV{CXX}) + unset(ENV{RC}) + unset(ENV{AR}) + unset(ENV{RUNLIB}) +else() + set(log_opts "") +endif() + + execute_process(COMMAND perl Configure @arch@ @opt@ @shared@ "--prefix=@openssl_install_dir@" "--openssldir=@openssl_dir@" RESULT_VARIABLE result) diff --git a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in index 2c18c75a91..85200f6433 100644 --- a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in @@ -104,6 +104,7 @@ set(openssl_install_dir "@HUNTER_PACKAGE_INSTALL_PREFIX@") # * opt # * shared # * NASM_ROOT +# * MSVC configure_file( "@HUNTER_PACKAGE_SETUP_DIR@/ep-stages/configure_1_1_plus.cmake.in" "@HUNTER_PACKAGE_BUILD_DIR@/configure_1_1_plus.cmake"