Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ if(ARROW_WITH_URIPARSER)
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS uriparser::uriparser)
endif()

if(PARQUET_BUILD_ENCRYPTION)
if(ARROW_USE_OPENSSL)
list(APPEND ARROW_LINK_LIBS OpenSSL::Crypto)
list(APPEND ARROW_STATIC_LINK_LIBS OpenSSL::Crypto)
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS OpenSSL::Crypto)
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ Note that this requires linking Boost statically" OFF)
#----------------------------------------------------------------------
set_option_category("Parquet")

define_option(PARQUET_BUILD_ENCRYPTION "Build Parquet with encryption support" ON)

define_option(PARQUET_MINIMAL_DEPENDENCY
"Depend only on Thirdparty headers to build libparquet. \
Always OFF if building binaries" OFF)
Expand All @@ -288,6 +286,8 @@ Always OFF if building binaries" OFF)
define_option(PARQUET_BUILD_EXAMPLES
"Build the Parquet examples. Requires static libraries to be built." OFF)

define_option(PARQUET_REQUIRE_ENCRYPTION "Fail if OpenSSL is not found" OFF)

#----------------------------------------------------------------------
set_option_category("Gandiva")

Expand Down
20 changes: 19 additions & 1 deletion cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,24 @@ if(ARROW_WITH_BROTLI)
include_directories(SYSTEM ${BROTLI_INCLUDE_DIR})
endif()

if(PARQUET_BUILD_ENCRYPTION OR ARROW_WITH_GRPC)
set(ARROW_USE_OPENSSL OFF)
if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET)
set(PARQUET_REQUIRE_ENCRYPTION OFF)
endif()
if(PARQUET_REQUIRE_ENCRYPTION OR ARROW_FLIGHT)
# This must work
find_package(OpenSSL REQUIRED)
set(ARROW_USE_OPENSSL ON)
elseif(ARROW_PARQUET)
# Enable Parquet encryption if OpenSSL is there, but don't fail if it's not
find_package(OpenSSL QUIET)
if(OPENSSL_FOUND)
set(ARROW_USE_OPENSSL ON)
endif()
endif()

if(ARROW_USE_OPENSSL)
message(STATUS "Building with OpenSSL support")
# OpenSSL::SSL and OpenSSL::Crypto
# are not available in older CMake versions (CMake < v3.2).
if(NOT TARGET OpenSSL::SSL)
Expand All @@ -750,6 +766,8 @@ if(PARQUET_BUILD_ENCRYPTION OR ARROW_WITH_GRPC)
endif()

include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
else()
message(STATUS "Building without OpenSSL support")
endif()

# ----------------------------------------------------------------------
Expand Down