Skip to content

Commit 30b757a

Browse files
committed
GH-45767: [C++] Fix Meson compilation issue with non-system Boost
1 parent 08089df commit 30b757a

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

cpp/meson.build

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ cpp_compiler = meson.get_compiler('cpp')
4646
cpp_args = cpp_compiler.get_supported_arguments(project_args)
4747
add_project_arguments(cpp_args, language: 'cpp')
4848

49+
if cpp_compiler.has_define('__SIZEOF_INT128__')
50+
add_project_arguments(['-DARROW_USE_NATIVE_INT128'], language: 'cpp')
51+
endif
52+
4953
git_id = get_option('git_id')
5054
if git_id == ''
5155
git_id = run_command('git', 'log', '-n1', '--format=%H', check: false).stdout().strip()

cpp/src/arrow/meson.build

+20-7
Original file line numberDiff line numberDiff line change
@@ -371,25 +371,38 @@ install_headers(
371371
)
372372

373373
if needs_tests
374-
filesystem_dep = dependency(
374+
boost_dep = dependency(
375375
'boost',
376376
modules: ['filesystem'],
377377
required: false,
378+
include_type: 'system',
378379
)
379-
if not filesystem_dep.found()
380+
381+
if boost_dep.found()
382+
boost_deps = [boost_dep]
383+
else
380384
cmake = import('cmake')
381385
boost_opt = cmake.subproject_options()
382386
boost_opt.add_cmake_defines(
383-
{'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'},
387+
{'BOOST_INCLUDE_LIBRARIES': 'asio;filesystem;process'},
384388
)
385389
boost_proj = cmake.subproject('boost', options: boost_opt)
386-
filesystem_dep = boost_proj.dependency('boost_filesystem')
390+
asio_dep = boost_proj.dependency('boost_asio', include_type: 'system')
391+
filesystem_dep = boost_proj.dependency(
392+
'boost_filesystem',
393+
include_type: 'system',
394+
)
395+
process_dep = boost_proj.dependency(
396+
'boost_process',
397+
include_type: 'system',
398+
)
399+
boost_deps = [asio_dep, filesystem_dep, process_dep]
387400
endif
388401

389402
gtest_main_dep = dependency('gtest_main')
390403
gmock_dep = dependency('gmock')
391404
else
392-
filesystem_dep = disabler()
405+
boost_deps = disabler()
393406
gtest_main_dep = disabler()
394407
gmock_dep = disabler()
395408
endif
@@ -399,13 +412,13 @@ arrow_test_lib = static_library(
399412
sources: arrow_testing_srcs,
400413
include_directories: [include_dir],
401414
link_with: [arrow_lib],
402-
dependencies: [filesystem_dep, gtest_main_dep],
415+
dependencies: [boost_deps, gtest_main_dep],
403416
)
404417

405418
arrow_test_dep = declare_dependency(
406419
link_with: [arrow_lib, arrow_test_lib],
407420
include_directories: [include_dir],
408-
dependencies: [filesystem_dep, gmock_dep, gtest_main_dep],
421+
dependencies: [boost_deps, gmock_dep, gtest_main_dep],
409422
)
410423

411424
array_array_test = executable(

cpp/subprojects/boost.wrap

-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@ source_filename = boost-1.87.0-cmake.tar.gz
2121
source_hash = 78fbf579e3caf0f47517d3fb4d9301852c3154bfecdc5eeebd9b2b0292366f5b
2222
directory = boost-1.87.0
2323
method = cmake
24-
25-
[provide]
26-
boost_filesystem = boost_filesystem_dep
27-
boost_system = boost_system_dep

0 commit comments

Comments
 (0)