diff Aws/AwsStaticConfiguration.cmake @ 146:5decdf0f0ef7

trying to build aws for windows
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Jun 2024 18:15:26 +0200
parents 3c7e0374f28e
children d2ebeaa18db2
line wrap: on
line diff
--- a/Aws/AwsStaticConfiguration.cmake	Thu May 30 22:35:35 2024 +0200
+++ b/Aws/AwsStaticConfiguration.cmake	Thu Jun 20 18:15:26 2024 +0200
@@ -79,11 +79,29 @@
 SET(AWS_CRT_CPP_MD5 "fa2cda44386bd56f1d4609c6a54a59f9")
 DownloadPackage(${AWS_CRT_CPP_MD5} ${AWS_CRT_CPP_URL} "${AWS_CRT_CPP_SOURCES_DIR}")
 
+
 SET(AWS_SDK_CPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/aws-sdk-cpp-1.11.178)  # source =  https://github.com/aws/aws-sdk-cpp/archive/refs/tags/1.11.178.tar.gz
 SET(AWS_SDK_CPP_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/aws/aws-sdk-cpp-1.11.178.tar.gz")
 SET(AWS_SDK_CPP_MD5 "a3f45888e939bb71506e0f7eaa630e48")
+
+if (IS_DIRECTORY "${AWS_SDK_CPP_SOURCES_DIR}")
+  set(FirstRun OFF)
+else()
+  set(FirstRun ON)
+endif()
+
 DownloadPackage(${AWS_SDK_CPP_MD5} ${AWS_SDK_CPP_URL} "${AWS_SDK_CPP_SOURCES_DIR}")
 
+if (FirstRun)
+  # This is a patch for Microsoft Visual Studio 2015
+  execute_process(
+    COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
+    ${CMAKE_CURRENT_LIST_DIR}/aws-sdk-cpp-1.11.178.patch
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    RESULT_VARIABLE Failure
+    )
+endif()
+
 
 configure_file(
   ${AWS_SDK_CPP_SOURCES_DIR}/src/aws-cpp-sdk-core/include/aws/core/SDKConfig.h.in
@@ -202,6 +220,14 @@
     ${AWS_C_IO_SOURCES_DIR}/source/windows/
     ${AWS_SDK_CPP_SOURCES_DIR}/src/aws-cpp-sdk-core/source/platform/windows/
     )
+
+  set(AWSSDK_LINK_LIBRARIES
+    ncrypt
+    secur32
+    shlwapi
+    userenv
+    version
+    )
 else()
   list(APPEND AWS_SOURCES_SUBDIRS
     #${AWS_C_CAL_SOURCES_DIR}/source/unix/
@@ -223,3 +249,9 @@
   ${AWS_C_COMMON_SOURCES_DIR}/source/arch/generic/cpuid.c
   ${AWS_CHECKSUMS_SOURCES_DIR}/source/generic/crc32c_null.c
   )
+
+
+list(REMOVE_ITEM AWS_SOURCES
+  # WARNING: "//" *is* important (don't replace it with "/")
+  ${AWS_C_IO_SOURCES_DIR}/source/windows//secure_channel_tls_handler.c
+  )