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 866d2cb9a1 GH-47203: [C++] Restore CMAKE_DEBUG_POSTFIX in building 
bundled Apache Thrift (#47209)
866d2cb9a1 is described below

commit 866d2cb9a1748ca6650025da5e09617be516105f
Author: Sutou Kouhei <k...@clear-code.com>
AuthorDate: Wed Jul 30 10:53:18 2025 +0900

    GH-47203: [C++] Restore CMAKE_DEBUG_POSTFIX in building bundled Apache 
Thrift (#47209)
    
    ### Rationale for this change
    
    If we use bundled Apache Thrift, `libarrowd.a` not `libarrow.a` may be 
built.
    Because Apache Thrift may change `CMAKE_DEBUG_POSTFIX`.
    
    ### What changes are included in this PR?
    
    Restore `CMAKE_DEBUG_POSTFIX` changed by Apache Thrift.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    * GitHub Issue: #47203
    
    Authored-by: Sutou Kouhei <k...@clear-code.com>
    Signed-off-by: Sutou Kouhei <k...@clear-code.com>
---
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 04c136b304..219c2393ce 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1767,6 +1767,10 @@ function(build_thrift)
   set(WITH_QT5 OFF)
   set(WITH_ZLIB OFF)
 
+  # Apache Thrift may change CMAKE_DEBUG_POSTFIX. So we'll restore the
+  # original CMAKE_DEBUG_POSTFIX later.
+  set(CMAKE_DEBUG_POSTFIX_KEEP ${CMAKE_DEBUG_POSTFIX})
+
   # Remove Apache Arrow's CMAKE_MODULE_PATH to ensure using Apache
   # Thrift's cmake_modules/.
   #
@@ -1775,6 +1779,12 @@ function(build_thrift)
   list(POP_FRONT CMAKE_MODULE_PATH)
   fetchcontent_makeavailable(thrift)
 
+  # Apache Thrift may change CMAKE_DEBUG_POSTFIX. So we restore
+  # CMAKE_DEBUG_POSTFIX.
+  set(CMAKE_DEBUG_POSTFIX
+      ${CMAKE_DEBUG_POSTFIX_KEEP}
+      CACHE BOOL "" FORCE)
+
   if(CMAKE_VERSION VERSION_LESS 3.28)
     set_property(DIRECTORY ${thrift_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
   endif()

Reply via email to