2021-04-02 02:48:23 +00:00
|
|
|
if(NOT OS_FREEBSD AND NOT APPLE)
|
2019-12-06 14:37:21 +00:00
|
|
|
option(ENABLE_S3 "Enable S3" ${ENABLE_LIBRARIES})
|
2020-08-19 08:55:04 +00:00
|
|
|
elseif(ENABLE_S3 OR USE_INTERNAL_AWS_S3_LIBRARY)
|
2021-04-02 02:48:23 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use S3 on Apple or FreeBSD")
|
2019-12-06 14:37:21 +00:00
|
|
|
endif()
|
2019-12-03 16:23:24 +00:00
|
|
|
|
2020-08-19 08:55:04 +00:00
|
|
|
if(NOT ENABLE_S3)
|
|
|
|
if(USE_INTERNAL_AWS_S3_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal S3 library with ENABLE_S3=OFF")
|
|
|
|
endif()
|
|
|
|
return()
|
|
|
|
endif()
|
2019-12-06 14:37:21 +00:00
|
|
|
|
2020-08-17 12:44:41 +00:00
|
|
|
option(USE_INTERNAL_AWS_S3_LIBRARY "Set to FALSE to use system S3 instead of bundled (experimental set to OFF on your own risk)"
|
|
|
|
ON)
|
|
|
|
|
|
|
|
if (NOT USE_INTERNAL_POCO_LIBRARY AND USE_INTERNAL_AWS_S3_LIBRARY)
|
|
|
|
message (FATAL_ERROR "Currently S3 support can be built only with internal POCO library")
|
|
|
|
endif()
|
|
|
|
|
2020-08-19 08:55:04 +00:00
|
|
|
if (NOT USE_INTERNAL_AWS_S3_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Compilation with external S3 library is not supported yet")
|
|
|
|
endif()
|
2019-12-06 14:37:21 +00:00
|
|
|
|
2020-08-19 08:55:04 +00:00
|
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/aws/aws-cpp-sdk-s3")
|
|
|
|
message (WARNING "submodule contrib/aws is missing. to fix try run: \n git submodule update --init --recursive")
|
|
|
|
if (USE_INTERNAL_AWS_S3_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal S3 library")
|
2019-12-03 16:23:24 +00:00
|
|
|
endif ()
|
2020-08-19 08:55:04 +00:00
|
|
|
set (MISSING_AWS_S3 1)
|
|
|
|
endif ()
|
2019-12-03 16:23:24 +00:00
|
|
|
|
2020-08-19 08:55:04 +00:00
|
|
|
if (USE_INTERNAL_AWS_S3_LIBRARY AND NOT MISSING_AWS_S3)
|
|
|
|
set(AWS_S3_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws/aws-cpp-sdk-s3/include")
|
|
|
|
set(AWS_S3_CORE_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws/aws-cpp-sdk-core/include")
|
|
|
|
set(AWS_S3_LIBRARY aws_s3)
|
|
|
|
set(USE_INTERNAL_AWS_S3_LIBRARY 1)
|
|
|
|
set(USE_AWS_S3 1)
|
|
|
|
else()
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't enable S3")
|
|
|
|
set(USE_INTERNAL_AWS_S3_LIBRARY 0)
|
|
|
|
set(USE_AWS_S3 0)
|
|
|
|
endif ()
|
2019-12-03 16:23:24 +00:00
|
|
|
|
|
|
|
message (STATUS "Using aws_s3=${USE_AWS_S3}: ${AWS_S3_INCLUDE_DIR} : ${AWS_S3_LIBRARY}")
|