Skip to content

Commit ec6ec9d

Browse files
committed
GH-46116: [C++] Implement IPC directory in Meson
1 parent 486670a commit ec6ec9d

File tree

4 files changed

+166
-2
lines changed

4 files changed

+166
-2
lines changed

cpp/meson.build

+17-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,23 @@ needs_filesystem = get_option('filesystem').enabled() or needs_azure or needs_gc
6666
needs_integration = get_option('integration').enabled()
6767
needs_tests = get_option('tests').enabled()
6868
needs_ipc = get_option('ipc').enabled() or needs_tests or needs_benchmarks
69-
needs_testing = get_option('testing').enabled() or needs_tests or needs_benchmarks or needs_integration
69+
needs_fuzzing = get_option('fuzzing')
70+
needs_testing = (get_option('testing').enabled()
71+
or needs_tests
72+
or needs_benchmarks
73+
or needs_fuzzing
74+
or needs_integration
75+
)
7076
needs_json = get_option('json').enabled() or needs_testing
77+
needs_brotli = get_option('brotli').enabled() or needs_fuzzing
78+
needs_lz4 = get_option('lz4').enabled()
79+
needs_zstd = get_option('zstd').enabled()
80+
needs_utilities = get_option('utilities').enabled()
81+
82+
if (get_option('brotli').enabled() or get_option('lz4').enabled() or get_option('zstd').enabled()
83+
)
84+
# See GH issue 46115
85+
error('Compression options (brotli, lz4, zstd) are not implemented in Meson')
86+
endif
7187

7288
subdir('src/arrow')

cpp/meson.options

+18-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ option(
2222
)
2323

2424
option('benchmarks', type: 'feature', description: 'Build the Arrow micro benchmarks')
25+
option('brotli', type: 'feature', description: 'Build with Brotli compression')
2526
option('csv', type: 'feature', description: 'Build the Arrow CSV Parser Module')
2627
option('filesystem', type: 'feature', description: 'Build the Arrow Filesystem Layer')
28+
option('fuzzing', type: 'feature', description: 'Build Arrow Fuzzing executables')
2729

2830
option(
2931
'gcs',
@@ -32,7 +34,12 @@ option(
3234
)
3335

3436
option('hdfs', type: 'feature', description: 'Build the Arrow HDFS bridge')
35-
option('integration', type: 'feature', description: 'Build the Arrow integration test executables')
37+
38+
option(
39+
'integration',
40+
type: 'feature',
41+
description: 'Build the Arrow integration test executables',
42+
)
3643

3744
option(
3845
'ipc',
@@ -45,6 +52,13 @@ option('json', type: 'feature', description: 'Build Arrow with JSON support')
4552
option('git_id', type: 'string')
4653
option('git_description', type: 'string')
4754

55+
option(
56+
'lz4',
57+
type: 'boolean',
58+
description: 'Build with lz4 compression',
59+
value: false,
60+
)
61+
4862
option(
4963
'package_kind',
5064
type: 'string',
@@ -58,3 +72,6 @@ option(
5872
)
5973
option('testing', type: 'feature', description: 'Build the Arrow testing libraries')
6074
option('tests', type: 'feature', description: 'Build the Arrow googletest unit tests')
75+
76+
option('utilities', type: 'feature', description: 'Build Arrow commandline utilities')
77+
option('zstd', type: 'feature', description: 'Build with zstd compression')

cpp/src/arrow/ipc/meson.build

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
exc = executable(
19+
'arrow-feather-test',
20+
sources: ['feather_test.cc'],
21+
dependencies: [arrow_test_dep, arrow_ipc_deps],
22+
)
23+
test('arrow-feather-test', exc)
24+
25+
ipc_tests = [
26+
'json_simple_test',
27+
'message_internal_test',
28+
'read_write_test',
29+
'tensor_test',
30+
]
31+
32+
foreach ipc_test : ipc_tests
33+
test_name = 'arrow-ipc-@0@'.format(ipc_test.replace('_', '-'))
34+
exc = executable(
35+
test_name,
36+
sources: ['@[email protected]'.format(ipc_test)],
37+
dependencies: [arrow_test_dep, arrow_ipc_deps],
38+
)
39+
test(test_name, exc)
40+
endforeach
41+
42+
install_headers(
43+
[
44+
'api.h',
45+
'dictionary.h',
46+
'feather.h',
47+
'json_simple.h',
48+
'message.h',
49+
'options.h',
50+
'reader.h',
51+
'test_common.h',
52+
'type_fwd.h',
53+
'util.h',
54+
'writer.h',
55+
],
56+
subdir: 'arrow/ipc',
57+
)
58+
59+
if needs_utilities or needs_integration
60+
file_to_stream_exc = executable(
61+
'arrow-file-to-stream',
62+
sources: ['file_to_stream.cc'],
63+
dependencies: [arrow_dep],
64+
install: needs_utilities,
65+
)
66+
67+
stream_to_file_exc = executable(
68+
'arrow-stream-to-file',
69+
sources: ['stream_to_file.cc'],
70+
dependencies: [arrow_dep],
71+
install: needs_utilities,
72+
)
73+
74+
if needs_integration
75+
# TODO: The CMake configuration would add these executables
76+
# to an arrow-integration target, which is in turn
77+
# used by arrow-all. The targets are modified, but not
78+
# used within Arrow C++ (?) - do we need to replicate that here?
79+
endif
80+
endif
81+
82+
exc = executable(
83+
'arrow-ipc-read-write-benchmark',
84+
sources: ['read_write_benchmark.cc'],
85+
dependencies: [arrow_benchmark_dep],
86+
)
87+
benchmark('arrow-ipc-read-write-benchmark', exc)
88+
89+
if needs_fuzzing or (needs_utilities
90+
and needs_testing
91+
and needs_lz4
92+
and needs_zstd
93+
)
94+
fuzz_corpus_exc = executable(
95+
'arrow-ipc-generate-fuzz-corpus',
96+
sources: ['generate_fuzz_corpus.cc'],
97+
dependencies: [arrow_test_dep],
98+
)
99+
100+
tensor_fuzz_corpus_exc = executable(
101+
'arrow-ipc-generate-tensor-fuzz-corpus',
102+
sources: ['generate_tensor_fuzz_corpus.cc'],
103+
dependencies: [arrow_test_dep],
104+
)
105+
endif
106+
107+
ipc_fuzz_targets = ['file_fuzz', 'stream_fuzz', 'tensor_stream_fuzz']
108+
109+
if needs_fuzzing
110+
if meson.version() < '1.8.0'
111+
error(
112+
' Meson >= 1.8.0 is required for fuzzing support, found @0@'.format(
113+
meson.version(),
114+
),
115+
)
116+
endif
117+
118+
foreach ipc_fuzz_target : ipc_fuzz_targets
119+
target_name = 'arrow-ipc-@0@'.format(ipc_fuzz_target.replace('_', '-'))
120+
executable(
121+
target_name,
122+
sources: ['@[email protected]'.format(ipc_fuzz_target)],
123+
dependencies: [arrow_dep],
124+
override_options: ['-Db_sanitize=fuzzer'],
125+
)
126+
endforeach
127+
endif

cpp/src/arrow/meson.build

+4
Original file line numberDiff line numberDiff line change
@@ -624,3 +624,7 @@ endif
624624
if needs_filesystem
625625
subdir('filesystem')
626626
endif
627+
628+
if needs_ipc
629+
subdir('ipc')
630+
endif

0 commit comments

Comments
 (0)