This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 0fbf982354 GH-45628: [C++] Ensure specifying Boost include directory 
for bundled Thrift (#45637)
0fbf982354 is described below

commit 0fbf9823542233c5f32c26534c34cc97ce3f0be2
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Feb 28 09:16:36 2025 +0900

    GH-45628: [C++] Ensure specifying Boost include directory for bundled 
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]>
---
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 9b531c8d5a..ef7b0b008f 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -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()

Reply via email to