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 fc0862a25f GH-45827: [C++] Add io directory to Meson configuration 
(#45828)
fc0862a25f is described below

commit fc0862a25fa2d6aa17df14daa9ad37430d432425
Author: William Ayd <[email protected]>
AuthorDate: Tue Mar 18 23:06:02 2025 -0400

    GH-45827: [C++] Add io directory to Meson configuration (#45828)
    
    ### Rationale for this change
    
    This continues building out the Meson C++ configuration
    
    ### What changes are included in this PR?
    
    This adds the io directory to the Meson configuration
    
    ### Are these changes tested?
    
    Yes
    
    ### Are there any user-facing changes?
    
    No
    
    * GitHub Issue: #45827
    
    Authored-by: Will Ayd <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/meson.build                   |  3 +-
 cpp/meson.options                 |  7 ++++
 cpp/src/arrow/io/meson.build      | 76 +++++++++++++++++++++++++++++++++++++++
 cpp/src/arrow/meson.build         |  3 +-
 cpp/src/arrow/testing/meson.build |  1 +
 5 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/cpp/meson.build b/cpp/meson.build
index 0fd75cc35f..688239fdd3 100644
--- a/cpp/meson.build
+++ b/cpp/meson.build
@@ -58,7 +58,8 @@ endif
 
 needs_benchmarks = get_option('benchmarks')
 needs_csv = get_option('csv')
-needs_filesystem = false
+needs_hdfs = get_option('hdfs')
+needs_filesystem = false or needs_hdfs
 needs_integration = false
 needs_tests = get_option('tests')
 needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks
diff --git a/cpp/meson.options b/cpp/meson.options
index 01bce102a7..d0f3ada76a 100644
--- a/cpp/meson.options
+++ b/cpp/meson.options
@@ -29,6 +29,13 @@ option(
     value: false,
 )
 
+option(
+    'hdfs',
+    type: 'boolean',
+    description: 'Build the Arrow HDFS bridge',
+    value: false,
+)
+
 option(
     'ipc',
     type: 'boolean',
diff --git a/cpp/src/arrow/io/meson.build b/cpp/src/arrow/io/meson.build
new file mode 100644
index 0000000000..9a59fbaac7
--- /dev/null
+++ b/cpp/src/arrow/io/meson.build
@@ -0,0 +1,76 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+io_tests = ['buffered_test', 'compressed_test', 'file_test', 'memory_test']
+
+foreach io_test : io_tests
+    test_name = 'arrow-io-@0@'.format(io_test.replace('_', '-'))
+    exc = executable(
+        test_name,
+        sources: '@[email protected]'.format(io_test),
+        dependencies: [arrow_test_dep],
+        implicit_include_directories: false,
+    )
+    test(test_name, exc)
+endforeach
+
+if needs_hdfs
+    hdfs_incdir = '../../../thirdparty/hadoop/include'
+    exc = executable(
+        'arrow-io-hdfs-test',
+        sources: 'hdfs_test.cc',
+        dependencies: [arrow_test_dep, filesystem_dep],
+        implicit_include_directories: false,
+        include_directories: [hdfs_incdir],
+    )
+    test('arrow-io-hdfs-test', exc)
+endif
+
+io_benchmarks = ['file_benchmark', 'compressed_benchmark']
+
+foreach io_benchmark : io_benchmarks
+    benchmark_name = 'arrow-io-@0@'.format(io_benchmark.replace('_', '-'))
+    exc = executable(
+        benchmark_name,
+        sources: '@[email protected]'.format(io_benchmark),
+        dependencies: [arrow_test_dep, benchmark_dep],
+        implicit_include_directories: false,
+    )
+    benchmark(benchmark_name, exc)
+endforeach
+
+# TODO: Add memory benchmark with SIMD. See GH-45823
+
+install_headers(
+    [
+        'api.h',
+        'buffered.h',
+        'caching.h',
+        'compressed.h',
+        'concurrency.h',
+        'file.h',
+        'hdfs.h',
+        'interfaces.h',
+        'memory.h',
+        'mman.h',
+        'slow.h',
+        'stdio.h',
+        'transform.h',
+        'type_fwd.h',
+    ],
+    subdir: 'arrow/io',
+)
diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build
index b2c59f1dd7..f8c610b3e6 100644
--- a/cpp/src/arrow/meson.build
+++ b/cpp/src/arrow/meson.build
@@ -371,7 +371,7 @@ install_headers(
         'visit_scalar_inline.h',
         'visit_type_inline.h',
     ],
-    install_dir: 'arrow',
+    subdir: 'arrow',
 )
 
 if needs_testing
@@ -531,6 +531,7 @@ pkg.generate(
 subdir('testing')
 
 subdir('c')
+subdir('io')
 subdir('util')
 
 if needs_csv
diff --git a/cpp/src/arrow/testing/meson.build 
b/cpp/src/arrow/testing/meson.build
index d1ebfe2edd..1b6e6a9540 100644
--- a/cpp/src/arrow/testing/meson.build
+++ b/cpp/src/arrow/testing/meson.build
@@ -35,6 +35,7 @@ install_headers(
         'util.h',
         'visibility.h',
     ],
+    subdir: 'arrow/testing',
 )
 
 if needs_tests

Reply via email to