From 7bf9078f67cb9d596fbb7d2ad1550cdd0ddfffa0 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 2 Jul 2024 10:17:10 -0600 Subject: [PATCH] Correct an issue using internal S3 API/SDK, reworked options so that instead of specifying S3_AWS support AND AWS-SDK or INTERNAL-SDK, you just specify which SDK you want to use and the inference is that you want to use S3 support. --- CMakeLists.txt | 9 +++++++-- cmake/dependencies.cmake | 6 +++--- libdispatch/ncs3sdk_h5.c | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1a523fb7..e0dd44fd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -735,13 +735,18 @@ if(NOT WIN32) endif() # Options for S3 Support -option(NETCDF_ENABLE_S3 "Enable S3 support." OFF) +#option(NETCDF_ENABLE_S3 "Enable S3 support." OFF) +option(NETCDF_ENABLE_S3_AWS "Enable S3 support via AWS-CPP-SDK" OFF) option(NETCDF_ENABLE_S3_INTERNAL "Enable S3 Internal support." OFF) -option(NETCDF_ENABLE_NCZARR_S3 "Enable NCZarr S3 support; Deprecated in favor of NETCDF_ENABLE_S3" OFF) + +cmake_dependent_option(NETCDF_ENABLE_S3 "Enable S3 Support" ON "NETCDF_ENABLE_S3_AWS OR NETCDF_ENABLE_S3_INTERNAL" OFF) + +option(NETCDF_ENABLE_NCZARR_S3 "Enable NCZarr S3 support; Deprecated in favor of NETCDF_ENABLE_S3" ${NETCDF_ENABLE_S3}) if(NOT NETCDF_ENABLE_REMOTE_FUNCTIONALITY) set(NETCDF_ENABLE_S3 OFF CACHE BOOL "" FORCE) set(NETCDF_ENABLE_S3_INTERNAL OFF CACHE BOOL "" FORCE) + set(NETCDF_ENABLE_S3_AWSS OFF CACHE BOOL "" FORCE) set(NETCDF_ENABLE_NCZARR_S3 OFF CACHE BOOL "" FORCE) endif() diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 3a35106de..6aaf3d862 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -429,7 +429,7 @@ endif () # because for some reason this screws up if we unconditionally test for sdk # and it is not available. Fix someday if(NETCDF_ENABLE_S3) - if(NOT NETCDF_ENABLE_S3_INTERNAL) + if(NETCDF_ENABLE_S3_AWS) # See if aws-s3-sdk is available find_package(AWSSDK REQUIRED COMPONENTS s3;transfer) if(AWSSDK_FOUND) @@ -441,7 +441,7 @@ if(NETCDF_ENABLE_S3) else(AWSSDK_FOUND) set(NETCDF_ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE) endif(AWSSDK_FOUND) - else(NOT NETCDF_ENABLE_S3_INTERNAL) + else(NETCDF_ENABLE_S3_INTERNAL) # Find crypto libraries required with testing with the internal s3 api. #find_library(SSL_LIB NAMES ssl openssl) find_package(OpenSSL REQUIRED) @@ -454,7 +454,7 @@ if(NETCDF_ENABLE_S3) # message(FATAL_ERROR "Can't find a crypto library, required by S3_INTERNAL") #endif(NOT CRYPTO_LIB) - endif(NOT NETCDF_ENABLE_S3_INTERNAL) + endif(NETCDF_ENABLE_S3_AWS) else() set(NETCDF_ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE) endif() diff --git a/libdispatch/ncs3sdk_h5.c b/libdispatch/ncs3sdk_h5.c index f8263293b..0f99dfb47 100644 --- a/libdispatch/ncs3sdk_h5.c +++ b/libdispatch/ncs3sdk_h5.c @@ -122,7 +122,7 @@ NC_s3sdkinitialize(void) } /* Get environment information */ - NC_s3sdkenvironment(void); + NC_s3sdkenvironment(); return NC_NOERR; }