Skip to content
Closed
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
1 change: 1 addition & 0 deletions ci/conda_env_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ninja
pkg-config
python
rapidjson
re2
snappy
thrift-cpp>=0.11.0
zlib
Expand Down
1 change: 0 additions & 1 deletion ci/conda_env_gandiva.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@

clangdev=11
llvmdev=11
re2
1 change: 0 additions & 1 deletion ci/conda_env_gandiva_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
# llvmdev=9 or later require Visual Studio 2017
clangdev=8
llvmdev=8
re2
12 changes: 12 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ if(ARROW_BUILD_BENCHMARKS
set(ARROW_TESTING ON)
endif()

if(ARROW_GANDIVA)
set(ARROW_WITH_RE2 ON)
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about forcing to enable/disable ARROW_WITH_RE2 in ThridpartyToolchain.cmake like ARROW_WITH_THRIFT?


if(ARROW_CUDA
OR ARROW_FLIGHT
OR ARROW_PARQUET
Expand Down Expand Up @@ -746,6 +750,14 @@ if(ARROW_WITH_UTF8PROC)
endif()
endif()

if(ARROW_WITH_RE2)
list(APPEND ARROW_LINK_LIBS RE2::re2)
list(APPEND ARROW_STATIC_LINK_LIBS RE2::re2)
if(RE2_SOURCE STREQUAL "SYSTEM")
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS RE2::re2)
endif()
endif()

add_custom_target(arrow_dependencies)
add_custom_target(arrow_benchmark_dependencies)
add_custom_target(arrow_test_dependencies)
Expand Down
10 changes: 8 additions & 2 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,14 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
define_option(ARROW_WITH_ZLIB "Build with zlib compression" OFF)
define_option(ARROW_WITH_ZSTD "Build with zstd compression" OFF)

define_option(ARROW_WITH_UTF8PROC
"Build with support for Unicode properties using the utf8proc library" ON)
define_option(
ARROW_WITH_UTF8PROC
"Build with support for Unicode properties using the utf8proc library;(only used if ARROW_COMPUTE is ON)"
ON)
define_option(
ARROW_WITH_RE2
"Build with support for regular expressions using the re2 library;(only used if ARROW_COMPUTE or ARROW_GANDIVA is ON)"
ON)

#----------------------------------------------------------------------
if(MSVC_TOOLCHAIN)
Expand Down
6 changes: 5 additions & 1 deletion cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ if(NOT ARROW_COMPUTE)
# utf8proc is only potentially used in kernels for now
set(ARROW_WITH_UTF8PROC OFF)
endif()
if((NOT ARROW_COMPUTE) AND (NOT ARROW_GANDIVA))
set(ARROW_WITH_RE2 OFF)
endif()

# ----------------------------------------------------------------------
# Versions and URLs for toolchain builds, which also can be used to configure
Expand Down Expand Up @@ -2090,8 +2093,9 @@ macro(build_re2)
list(APPEND ARROW_BUNDLED_STATIC_LIBS RE2::re2)
endmacro()

if(ARROW_GANDIVA)
if(ARROW_WITH_RE2)
resolve_dependency(RE2)
add_definitions(-DARROW_WITH_RE2)

# TODO: Don't use global includes but rather target_include_directories
get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES)
Expand Down