Skip to content

Commit fc0862a

Browse files
authored
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]>
1 parent 997cf7a commit fc0862a

File tree

5 files changed

+88
-2
lines changed

5 files changed

+88
-2
lines changed

cpp/meson.build

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ endif
5858

5959
needs_benchmarks = get_option('benchmarks')
6060
needs_csv = get_option('csv')
61-
needs_filesystem = false
61+
needs_hdfs = get_option('hdfs')
62+
needs_filesystem = false or needs_hdfs
6263
needs_integration = false
6364
needs_tests = get_option('tests')
6465
needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks

cpp/meson.options

+7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ option(
2929
value: false,
3030
)
3131

32+
option(
33+
'hdfs',
34+
type: 'boolean',
35+
description: 'Build the Arrow HDFS bridge',
36+
value: false,
37+
)
38+
3239
option(
3340
'ipc',
3441
type: 'boolean',

cpp/src/arrow/io/meson.build

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
io_tests = ['buffered_test', 'compressed_test', 'file_test', 'memory_test']
19+
20+
foreach io_test : io_tests
21+
test_name = 'arrow-io-@0@'.format(io_test.replace('_', '-'))
22+
exc = executable(
23+
test_name,
24+
sources: '@[email protected]'.format(io_test),
25+
dependencies: [arrow_test_dep],
26+
implicit_include_directories: false,
27+
)
28+
test(test_name, exc)
29+
endforeach
30+
31+
if needs_hdfs
32+
hdfs_incdir = '../../../thirdparty/hadoop/include'
33+
exc = executable(
34+
'arrow-io-hdfs-test',
35+
sources: 'hdfs_test.cc',
36+
dependencies: [arrow_test_dep, filesystem_dep],
37+
implicit_include_directories: false,
38+
include_directories: [hdfs_incdir],
39+
)
40+
test('arrow-io-hdfs-test', exc)
41+
endif
42+
43+
io_benchmarks = ['file_benchmark', 'compressed_benchmark']
44+
45+
foreach io_benchmark : io_benchmarks
46+
benchmark_name = 'arrow-io-@0@'.format(io_benchmark.replace('_', '-'))
47+
exc = executable(
48+
benchmark_name,
49+
sources: '@[email protected]'.format(io_benchmark),
50+
dependencies: [arrow_test_dep, benchmark_dep],
51+
implicit_include_directories: false,
52+
)
53+
benchmark(benchmark_name, exc)
54+
endforeach
55+
56+
# TODO: Add memory benchmark with SIMD. See GH-45823
57+
58+
install_headers(
59+
[
60+
'api.h',
61+
'buffered.h',
62+
'caching.h',
63+
'compressed.h',
64+
'concurrency.h',
65+
'file.h',
66+
'hdfs.h',
67+
'interfaces.h',
68+
'memory.h',
69+
'mman.h',
70+
'slow.h',
71+
'stdio.h',
72+
'transform.h',
73+
'type_fwd.h',
74+
],
75+
subdir: 'arrow/io',
76+
)

cpp/src/arrow/meson.build

+2-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ install_headers(
371371
'visit_scalar_inline.h',
372372
'visit_type_inline.h',
373373
],
374-
install_dir: 'arrow',
374+
subdir: 'arrow',
375375
)
376376

377377
if needs_testing
@@ -531,6 +531,7 @@ pkg.generate(
531531
subdir('testing')
532532

533533
subdir('c')
534+
subdir('io')
534535
subdir('util')
535536

536537
if needs_csv

cpp/src/arrow/testing/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ install_headers(
3535
'util.h',
3636
'visibility.h',
3737
],
38+
subdir: 'arrow/testing',
3839
)
3940

4041
if needs_tests

0 commit comments

Comments
 (0)