Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-10541: [C++] Add re2 library to core arrow / ARROW_WITH_RE2 #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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()

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(utf8proc_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
2 changes: 2 additions & 0 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")

define_option(ARROW_WITH_UTF8PROC
"Build with support for Unicode properties using the utf8proc library" ON)
define_option(ARROW_WITH_RE2
"Build with support for regular expressions using the re2 library" 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