Skip to content

Commit 9c8d212

Browse files
committed
GH-46147: [C++] Implement GCS support in Meson
1 parent 2e90823 commit 9c8d212

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

ci/scripts/cpp_build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ if [ "${ARROW_USE_MESON:-OFF}" = "ON" ]; then
145145
--pkg-config-path="${CONDA_PREFIX}/lib/pkgconfig/" \
146146
-Dauto_features=enabled \
147147
-Dfuzzing=disabled \
148-
-Dgcs=disabled \
149148
-Ds3=disabled \
150149
. \
151150
${source_dir}

cpp/src/arrow/meson.build

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,52 @@ if needs_filesystem
409409
endif
410410

411411
if needs_gcs
412-
error('gcs filesystem support is not yet implemented in Meson')
412+
arrow_filesystem_srcs += files(
413+
'filesystem/gcsfs.cc',
414+
'filesystem/gcsfs_internal.cc',
415+
)
416+
417+
gcs_common_dep = dependency(
418+
'google_cloud_cpp_common',
419+
allow_fallback: false,
420+
required: false,
421+
)
422+
gcs_rest_internal_dep = dependency(
423+
'google_cloud_cpp_rest_internal',
424+
allow_fallback: false,
425+
required: false,
426+
)
427+
gcs_storage_dep = dependency(
428+
'google_cloud_cpp_storage',
429+
allow_fallback: false,
430+
required: false,
431+
)
432+
433+
if not (gcs_common_dep.found()
434+
and gcs_rest_internal_dep.found()
435+
and gcs_storage_dep.found()
436+
)
437+
error(
438+
'''
439+
The Arrow Meson configuration requires that google_cloud_cpp_common,
440+
google_cloud_cpp_rest_internal, and google_cloud_cpp_storage be provided
441+
by the host system, but these could not be found. Subproject fallback is
442+
not implemented.
443+
444+
Ensure that you have all of these components installed on your system, or
445+
disable Arrow gcs support with -Dgcs=disabled.
446+
''',
447+
)
448+
endif
449+
450+
gcs_dep = declare_dependency(
451+
dependencies: [
452+
gcs_common_dep,
453+
gcs_rest_internal_dep,
454+
gcs_storage_dep,
455+
],
456+
)
457+
arrow_filesystem_deps += [gcs_dep]
413458
endif
414459

415460
if needs_hdfs
@@ -622,6 +667,7 @@ if needs_testing
622667
boost_opt = cmake.subproject_options()
623668
boost_opt.add_cmake_defines(
624669
{'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'},
670+
{'CMAKE_CXX_FLAGS': '-fPIC'},
625671
)
626672
boost_proj = cmake.subproject('boost', options: boost_opt)
627673
filesystem_dep = boost_proj.dependency('boost_filesystem')

cpp/src/arrow/util/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ conf_data.set('ARROW_PARQUET', needs_parquet)
5454
conf_data.set('ARROW_SUBSTRAIT', false)
5555
conf_data.set('ARROW_AZURE', false)
5656
conf_data.set('ARROW_ENABLE_THREADING', true)
57-
conf_data.set('ARROW_GCS', false)
57+
conf_data.set('ARROW_GCS', needs_gcs)
5858
conf_data.set('ARROW_HDFS', false)
5959
conf_data.set('ARROW_S3', false)
6060
conf_data.set('ARROW_USE_GLOG', false)

0 commit comments

Comments
 (0)