2022-01-17 19:42:00 +00:00
|
|
|
option (ENABLE_AZURE_BLOB_STORAGE "Enable Azure blob storage" ${ENABLE_LIBRARIES})
|
|
|
|
|
2023-06-27 10:11:04 +00:00
|
|
|
if (NOT ENABLE_AZURE_BLOB_STORAGE OR OS_FREEBSD)
|
2022-01-17 19:42:00 +00:00
|
|
|
message(STATUS "Not using Azure blob storage")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2021-11-30 15:48:21 +00:00
|
|
|
set(AZURE_DIR "${ClickHouse_SOURCE_DIR}/contrib/azure")
|
2021-09-27 13:32:34 +00:00
|
|
|
set(AZURE_SDK_LIBRARY_DIR "${AZURE_DIR}/sdk")
|
2021-09-27 09:31:27 +00:00
|
|
|
|
|
|
|
file(GLOB AZURE_SDK_CORE_SRC
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/cryptography/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/http/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/http/curl/*.hpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/http/curl/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/winhttp/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/io/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/src/private/*.hpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB AZURE_SDK_IDENTITY_SRC
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/identity/azure-identity/src/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/identity/azure-identity/src/private/*.hpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB AZURE_SDK_STORAGE_COMMON_SRC
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/storage/azure-storage-common/src/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/storage/azure-storage-common/src/private/*.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB AZURE_SDK_STORAGE_BLOBS_SRC
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/storage/azure-storage-blobs/src/*.cpp"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/storage/azure-storage-blobs/src/private/*.hpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB AZURE_SDK_UNIFIED_SRC
|
|
|
|
${AZURE_SDK_CORE_SRC}
|
|
|
|
${AZURE_SDK_IDENTITY_SRC}
|
|
|
|
${AZURE_SDK_STORAGE_COMMON_SRC}
|
|
|
|
${AZURE_SDK_STORAGE_BLOBS_SRC}
|
|
|
|
)
|
|
|
|
|
|
|
|
set(AZURE_SDK_INCLUDES
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/core/azure-core/inc/"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/identity/azure-identity/inc/"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/storage/azure-storage-common/inc/"
|
|
|
|
"${AZURE_SDK_LIBRARY_DIR}/storage/azure-storage-blobs/inc/"
|
|
|
|
)
|
|
|
|
|
2022-01-17 19:42:00 +00:00
|
|
|
add_library(_azure_sdk ${AZURE_SDK_UNIFIED_SRC})
|
2023-11-17 07:07:32 +00:00
|
|
|
target_compile_definitions(_azure_sdk PRIVATE BUILD_CURL_HTTP_TRANSPORT_ADAPTER)
|
2021-11-15 10:31:46 +00:00
|
|
|
|
2021-09-27 13:32:34 +00:00
|
|
|
# Originally, on Windows azure-core is built with bcrypt and crypt32 by default
|
2022-01-17 05:45:10 +00:00
|
|
|
if (TARGET OpenSSL::SSL)
|
2022-01-17 19:42:00 +00:00
|
|
|
target_link_libraries(_azure_sdk PRIVATE OpenSSL::Crypto OpenSSL::SSL)
|
2021-09-27 09:31:27 +00:00
|
|
|
endif()
|
|
|
|
|
2021-09-27 13:32:34 +00:00
|
|
|
# Originally, on Windows azure-core is built with winhttp by default
|
2022-01-17 22:02:56 +00:00
|
|
|
if (TARGET ch_contrib::curl)
|
|
|
|
target_link_libraries(_azure_sdk PRIVATE ch_contrib::curl)
|
2021-09-27 13:32:34 +00:00
|
|
|
endif()
|
2021-09-27 09:31:27 +00:00
|
|
|
|
2022-01-17 21:51:17 +00:00
|
|
|
target_link_libraries(_azure_sdk PRIVATE ch_contrib::libxml2)
|
2022-01-17 19:42:00 +00:00
|
|
|
|
|
|
|
target_include_directories(_azure_sdk SYSTEM BEFORE PUBLIC ${AZURE_SDK_INCLUDES})
|
2021-09-27 09:31:27 +00:00
|
|
|
|
2022-01-17 19:42:00 +00:00
|
|
|
add_library(ch_contrib::azure_sdk ALIAS _azure_sdk)
|