Skip to content

Commit 45b61e8

Browse files
committed
GH-46410: [C++] Add parquet options to Meson configuration
1 parent f1c6619 commit 45b61e8

File tree

12 files changed

+553
-9
lines changed

12 files changed

+553
-9
lines changed

cpp/examples/parquet/meson.build

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
example_execs = {
19+
'parquet-low-level-example': {
20+
'sources': files('low_level_api/reader_writer.cc'),
21+
'include_dir': include_directories('low_level_api'),
22+
},
23+
'parquet-low-level-example2': {
24+
'sources': files('low_level_api/reader_writer2.cc'),
25+
'include_dir': include_directories('low_level_api'),
26+
},
27+
'parquet-arrow-example': {
28+
'sources': files('parquet_arrow/reader_writer.cc'),
29+
},
30+
'parquet-stream-api-example': {
31+
'sources': files('parquet_stream_api/stream_reader_writer.cc'),
32+
},
33+
}
34+
35+
if get_option('parquet_require_encryption').enabled()
36+
example_execs += {
37+
'parquet-encryption-example': {
38+
'sources': files('low_level_api/encryption_reader_writer.cc'),
39+
'include_dir': include_directories('low_level_api'),
40+
},
41+
'parquet-encryption-example-all-crypto-options': {
42+
'sources': files(
43+
'low_level_api/encryption_reader_writer_all_crypto_options.cc',
44+
),
45+
'include_dir': include_directories('low_level_api'),
46+
},
47+
}
48+
endif
49+
50+
foreach key, val : example_execs
51+
executable(
52+
key,
53+
sources: val['sources'],
54+
include_directories: val.get('include_dir', []),
55+
dependencies: [arrow_dep, parquet_dep],
56+
)
57+
endforeach

cpp/meson.build

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,25 @@ needs_filesystem = get_option('filesystem').enabled() or needs_azure or needs_gc
6767
needs_integration = get_option('integration').enabled()
6868
needs_tests = get_option('tests').enabled()
6969
needs_acero = get_option('acero').enabled()
70-
needs_ipc = get_option('ipc').enabled() or needs_tests or needs_acero or needs_benchmarks
70+
needs_parquet = get_option('parquet').enabled()
71+
needs_ipc = (get_option('ipc').enabled()
72+
or needs_tests
73+
or needs_acero
74+
or needs_benchmarks
75+
or needs_parquet
76+
)
77+
7178
needs_fuzzing = get_option('fuzzing').enabled()
79+
if needs_fuzzing
80+
if meson.version() < '1.8.0'
81+
error(
82+
' Meson >= 1.8.0 is required for fuzzing support, found @0@'.format(
83+
meson.version(),
84+
),
85+
)
86+
endif
87+
endif
88+
7289
needs_testing = (get_option('testing').enabled()
7390
or needs_tests
7491
or needs_benchmarks
@@ -85,3 +102,11 @@ needs_zstd = get_option('zstd').enabled()
85102
needs_utilities = get_option('utilities').enabled()
86103

87104
subdir('src/arrow')
105+
106+
if needs_parquet
107+
subdir('src/parquet')
108+
subdir('tools/parquet')
109+
if get_option('parquet_build_examples').enabled()
110+
subdir('examples/parquet')
111+
endif
112+
endif

cpp/meson.options

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ option(
6666
type: 'string',
6767
description: 'Arbitrary string that identifies the kind of package (for informational purposes)',
6868
)
69+
option('parquet', type: 'feature', description: 'Build the Parquet libraries')
70+
option(
71+
'parquet_build_executables',
72+
type: 'feature',
73+
description: 'Build the Parquet executable CLI tools.',
74+
)
75+
option(
76+
'parquet_build_examples',
77+
type: 'feature',
78+
description: 'Build the Parquet examples.',
79+
)
80+
option(
81+
'parquet_require_encryption',
82+
type: 'feature',
83+
description: 'Build support for encryption. Fail if OpenSSL is not found',
84+
)
6985

7086
option('snappy', type: 'feature', description: 'Build with snappy compression')
7187
option(

cpp/src/arrow/ipc/meson.build

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,6 @@ endif
9494
ipc_fuzz_targets = ['file_fuzz', 'stream_fuzz', 'tensor_stream_fuzz']
9595

9696
if needs_fuzzing
97-
if meson.version() < '1.8.0'
98-
error(
99-
' Meson >= 1.8.0 is required for fuzzing support, found @0@'.format(
100-
meson.version(),
101-
),
102-
)
103-
endif
104-
10597
foreach ipc_fuzz_target : ipc_fuzz_targets
10698
target_name = 'arrow-ipc-@0@'.format(ipc_fuzz_target.replace('_', '-'))
10799
executable(

cpp/src/parquet/api/meson.build

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
install_headers(
19+
['io.h', 'reader.h', 'schema.h', 'writer.h'],
20+
subdir: 'parquet/api',
21+
)

cpp/src/parquet/arrow/meson.build

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
install_headers(
19+
['reader.h', 'schema.h', 'test_util.h', 'writer.h'],
20+
subdir: 'parquet/arrow',
21+
)
22+
23+
if needs_fuzzing
24+
executable(
25+
'parquet-arrow-generate-fuzz-corpus',
26+
sources: ['generate_fuzz_corpus.cc'],
27+
dependencies: [arrow_parquet_dep, arrow_test_dep],
28+
)
29+
30+
exeuctable('parquet-arrow-fuzz', sources: ['fuzz.cc'])
31+
endif
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
install_headers(
19+
[
20+
'crypto_factory.h',
21+
'encryption.h',
22+
'file_key_material_store.h',
23+
'file_key_unwrapper.h',
24+
'file_key_wrapper.h',
25+
'file_system_key_material_store.h',
26+
'key_encryption_key.h',
27+
'key_material.h',
28+
'key_metadata.h',
29+
'key_toolkit.h',
30+
'kms_client_factory.h',
31+
'kms_client.h',
32+
'local_wrap_kms_client.h',
33+
'test_encryption_util.h',
34+
'test_in_memory_kms.h',
35+
'two_level_cache_with_expiration.h',
36+
'type_fwd.h',
37+
],
38+
subdir: 'parquet/encryption',
39+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
install_headers(['statistics.h'], subdir: 'parquet/geospatial')

0 commit comments

Comments
 (0)