diff --git a/cpp/meson.build b/cpp/meson.build index 0fd75cc35f59..688239fdd3e4 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 01bce102a75f..d0f3ada76aa4 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 000000000000..9a59fbaac7f4 --- /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: '@0@.cc'.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: '@0@.cc'.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 b2c59f1dd7e8..f8c610b3e636 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 d1ebfe2eddbb..1b6e6a9540d9 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