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 417df286df GH-47539: [C++] Detect Snappy and bzip2 in Meson CI (#47540)
417df286df is described below

commit 417df286dfaf0a20280684fd0093e5fac589e42b
Author: William Ayd <[email protected]>
AuthorDate: Tue Sep 9 20:17:36 2025 -0400

    GH-47539: [C++] Detect Snappy and bzip2 in Meson CI (#47540)
    
    ### Rationale for this change
    
    This should help find system-provided installs of Snappy and bzip2, so that 
they don't need to be built as subprojects
    
    ### What changes are included in this PR?
    
    Changes to the Meson configuration to detect these libraries
    
    ### Are these changes tested?
    
    Yes
    
    ### Are there any user-facing changes?
    
    No
    * GitHub Issue: #47539
    
    Authored-by: Will Ayd <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/meson.build | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build
index 33a9c6ed40..3ea103da9e 100644
--- a/cpp/src/arrow/meson.build
+++ b/cpp/src/arrow/meson.build
@@ -223,7 +223,16 @@ endif
 
 if needs_bz2
     arrow_util_srcs += ['util/compression_bz2.cc']
-    arrow_util_deps += dependency('bzip2')
+    bzip2 = cpp_compiler.find_library(
+        'bz2',
+        has_headers: ['bzlib.h'],
+        required: false,
+    )
+    if bzip2.found()
+        arrow_util_deps += bzip2
+    else
+        arrow_util_deps += dependency('bzip2')
+    endif
 endif
 
 if needs_lz4
@@ -233,7 +242,7 @@ endif
 
 if needs_snappy
     arrow_util_srcs += ['util/compression_snappy.cc']
-    arrow_util_deps += dependency('snappy')
+    arrow_util_deps += dependency('snappy', 'Snappy')
 endif
 
 if needs_zlib

Reply via email to