changeset 4368:781f53eee856

fix OpenSslConfigurationStatic-1.1.1.cmake to generate windows plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 12 Dec 2020 19:41:30 +0100
parents 189e48f4a92a
children e980d584434a
files OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-1.0.2.cmake OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-1.1.1.cmake
diffstat 2 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-1.0.2.cmake	Thu Dec 10 18:36:57 2020 +0100
+++ b/OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-1.0.2.cmake	Sat Dec 12 19:41:30 2020 +0100
@@ -124,7 +124,7 @@
   # The following patch of "e_os2.h" prevents from building OpenSSL
   # as a DLL under Windows. Otherwise, symbols have inconsistent
   # linkage if ${OPENSSL_SOURCES} is used to create a DLL (notably
-  # if building an Orthanc plugin such as MySQL).
+  # if building an Orthanc plugin such as PostgreSQL or MySQL).
   file(WRITE ${OPENSSL_SOURCES_DIR}/include/openssl/e_os2.h "
 #include \"e_os2_source.h\"
 #if defined(_WIN32)
--- a/OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-1.1.1.cmake	Thu Dec 10 18:36:57 2020 +0100
+++ b/OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-1.1.1.cmake	Sat Dec 12 19:41:30 2020 +0100
@@ -55,6 +55,29 @@
   if (Failure)
     message(FATAL_ERROR "Error while patching a file")
   endif()
+
+  file(RENAME
+    ${OPENSSL_SOURCES_DIR}/include/openssl/e_os2.h
+    ${OPENSSL_SOURCES_DIR}/include/openssl/e_os2_source.h)
+
+  # The following patch of "e_os2.h" prevents from building OpenSSL
+  # as a DLL under Windows. Otherwise, symbols have inconsistent
+  # linkage if ${OPENSSL_SOURCES} is used to create a DLL (notably
+  # if building an Orthanc plugin such as PostgreSQL or MySQL).
+  file(WRITE ${OPENSSL_SOURCES_DIR}/include/openssl/e_os2.h "
+#include \"e_os2_source.h\"
+#if defined(_WIN32)
+#  undef OPENSSL_EXPORT
+#  undef OPENSSL_IMPORT
+#  undef OPENSSL_EXTERN
+#  undef OPENSSL_GLOBAL
+#  define OPENSSL_EXPORT
+#  define OPENSSL_IMPORT
+#  define OPENSSL_EXTERN extern
+#  define OPENSSL_GLOBAL
+#endif
+")
+
 else()
   message("The patches for OpenSSL have already been applied")
 endif()