Skip to content

Commit 417df28

Browse files
authored
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]>
1 parent c155e99 commit 417df28

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cpp/src/arrow/meson.build

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,16 @@ endif
223223

224224
if needs_bz2
225225
arrow_util_srcs += ['util/compression_bz2.cc']
226-
arrow_util_deps += dependency('bzip2')
226+
bzip2 = cpp_compiler.find_library(
227+
'bz2',
228+
has_headers: ['bzlib.h'],
229+
required: false,
230+
)
231+
if bzip2.found()
232+
arrow_util_deps += bzip2
233+
else
234+
arrow_util_deps += dependency('bzip2')
235+
endif
227236
endif
228237

229238
if needs_lz4
@@ -233,7 +242,7 @@ endif
233242

234243
if needs_snappy
235244
arrow_util_srcs += ['util/compression_snappy.cc']
236-
arrow_util_deps += dependency('snappy')
245+
arrow_util_deps += dependency('snappy', 'Snappy')
237246
endif
238247

239248
if needs_zlib

0 commit comments

Comments
 (0)