Skip to content

Commit

Permalink
GH-45628: [C++] Ensure specifying Boost include directory for bundled…
Browse files Browse the repository at this point in the history
… Thrift (#45637)

### Rationale for this change

We must use the Boost for Apache Arrow C++ itself and bundled libraries including Apache Thrift. We can enforce it by specifying the target Boost explicitly instead of detecting Boost in each bundled libraries.

### What changes are included in this PR?

Always specify `-DBoost_INCLUDE_DIR`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* GitHub Issue: #45628

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored Feb 28, 2025
1 parent e2ac52d commit 0fbf982
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1773,9 +1773,10 @@ macro(build_thrift)
if(DEFINED BOOST_ROOT)
list(APPEND THRIFT_CMAKE_ARGS "-DBOOST_ROOT=${BOOST_ROOT}")
endif()
if(DEFINED Boost_INCLUDE_DIR)
list(APPEND THRIFT_CMAKE_ARGS "-DBoost_INCLUDE_DIR=${Boost_INCLUDE_DIR}")
endif()
list(APPEND
THRIFT_CMAKE_ARGS
"-DBoost_INCLUDE_DIR=$<TARGET_PROPERTY:Boost::headers,INTERFACE_INCLUDE_DIRECTORIES>"
)
if(DEFINED Boost_NAMESPACE)
list(APPEND THRIFT_CMAKE_ARGS "-DBoost_NAMESPACE=${Boost_NAMESPACE}")
endif()
Expand Down

0 comments on commit 0fbf982

Please sign in to comment.