Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2f7048f

Browse files
committedFeb 6, 2025·
GH-41816: [C++] Meson Build System Support
1 parent 1567be0 commit 2f7048f

17 files changed

+1226
-0
lines changed
 

‎.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,8 @@ repos:
197197
?^c_glib/test/run-test\.sh$|
198198
?^dev/release/utils-generate-checksum\.sh$|
199199
)
200+
- repo: https://github.com/trim21/pre-commit-mirror-meson
201+
rev: v1.6.1
202+
hooks:
203+
- id: meson-fmt
204+
args: ['--inplace']

‎cpp/meson.build

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
project(
19+
'arrow',
20+
'cpp',
21+
'c',
22+
version: '19.0.0-SNAPSHOT',
23+
license: 'Apache 2.0',
24+
meson_version: '>=1.3.0',
25+
default_options: [
26+
'buildtype=release',
27+
'c_std=c99',
28+
'warning_level=2',
29+
'cpp_std=c++17',
30+
],
31+
)
32+
33+
project_args = [
34+
'-Wno-unused-parameter',
35+
'-Wno-array-bounds',
36+
'-Wno-stringop-overflow',
37+
'-Wno-aggressive-loop-optimizations',
38+
'-Wno-nonnull',
39+
]
40+
41+
c_compiler = meson.get_compiler('c')
42+
c_args = c_compiler.get_supported_arguments(project_args)
43+
add_project_arguments(c_args, language: 'c')
44+
45+
cpp_compiler = meson.get_compiler('cpp')
46+
cpp_args = cpp_compiler.get_supported_arguments(project_args)
47+
add_project_arguments(cpp_args, language: 'cpp')
48+
49+
needs_tests = get_option('tests')
50+
needs_ipc = needs_tests or get_option('ipc')
51+
needs_testing = needs_tests or get_option('testing')
52+
needs_json = needs_testing or get_option('json')
53+
needs_compute = get_option('compute')
54+
55+
subdir('src/arrow')

‎cpp/meson.options

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
option('compute', type: 'boolean', description: 'Build compute', value: false)
19+
option('ipc', type: 'boolean', description: 'Build IPC', value: false)
20+
option(
21+
'json',
22+
type: 'boolean',
23+
description: 'Build Arrow with JSON support (requires RapidJSON)',
24+
value: false,
25+
)
26+
option(
27+
'testing',
28+
type: 'boolean',
29+
description: 'Build the Arrow testing libraries',
30+
value: false,
31+
)
32+
option('tests', type: 'boolean', description: 'Build tests', value: false)

‎cpp/src/arrow/array/meson.build

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
tests = {
19+
'arrow-concatenate-test': {'sources': ['concatenate_test.cc']},
20+
'arrow-diff-test': {'sources': ['diff_test.cc']},
21+
}
22+
23+
foreach key, val : tests
24+
exc = executable(
25+
key,
26+
sources: val['sources'],
27+
dependencies: [arrow_test_dep],
28+
)
29+
test(key, exc)
30+
endforeach
31+
32+
# TODO: arrow_install_all_headers

‎cpp/src/arrow/c/meson.build

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
tests = {
19+
'arrow-c-bridge-test': {'sources': ['bridge_test.cc']},
20+
'arrow-dlpack-test': {'sources': ['dlpack_test.cc']},
21+
}
22+
23+
foreach key, val : tests
24+
exc = executable(
25+
key,
26+
sources: val['sources'],
27+
dependencies: [arrow_test_dep],
28+
)
29+
test(key, exc)
30+
endforeach
31+
32+
# add_arrow_benchmark(bridge_benchmark)
33+
# TODO: arrow_install_all_headers
+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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+
# TODO: arrow_install_all_headers
19+
# TODO: add_pkg_config
20+
21+
compute_kernels_test_util_srcs = [
22+
'../test_util_internal.cc',
23+
'test_util_internal.cc',
24+
]
25+
26+
tests = {'scalar-cast-test': {'sources': ['scalar_cast_test.cc']}}
27+
28+
if needs_compute
29+
tests += {
30+
'arrow-compute-scalar-type-test': {
31+
'sources': [
32+
'scalar_boolean_test.cc',
33+
'scalar_nested_test.cc',
34+
'scalar_string_test.cc',
35+
],
36+
},
37+
'arrow-compute-scalar-if-else-test': {
38+
'sources': ['scalar_if_else_test.cc'],
39+
},
40+
'arrow-compute-scalar-temporal-test': {
41+
'sources': ['scalar_temporal_test.cc'],
42+
},
43+
'arrow-compute-scalar-match-test': {
44+
'sources': [
45+
'scalar_arithmetic_test.cc',
46+
'scalar_compare_test.cc',
47+
'scalar_round_arithmetic_test.cc',
48+
],
49+
},
50+
'arrow-compute-scalar-utility-test': {
51+
'sources': [
52+
'scalar_random_test.cc',
53+
'scalar_set_lookup_test.cc',
54+
'scalar_validity_test.cc',
55+
],
56+
},
57+
# Vector tests
58+
'arrow-compute-vector-test': {
59+
'sources': [
60+
'vector_cumulative_ops_test.cc',
61+
'vector_pairwise_test.cc',
62+
'vector_hash_test.cc',
63+
'vector_nested_test.cc',
64+
'vector_replace_test.cc',
65+
'vector_run_end_encode_test.cc',
66+
'select_k_test.cc',
67+
],
68+
},
69+
'arrow-compute-vector-sort-test': {'sources': ['vector_sort_test.cc']},
70+
'arrow-compute-vector-selection-test': {
71+
'sources': ['vector_selection_test.cc'],
72+
},
73+
'arrow-compute-vector-swizzle-test': {
74+
'sources': ['vector_swizzle_test.cc'],
75+
},
76+
# Aggregates
77+
'arrow-compute-aggregate-test': {'sources': ['aggregate_test.cc']},
78+
# Utilities
79+
'arrow-compute-kernel-utility-test': {
80+
'sources': ['codegen_internal_test.cc'],
81+
},
82+
}
83+
endif
84+
85+
foreach key, val : tests
86+
exc = executable(
87+
key,
88+
sources: compute_kernels_test_util_srcs + val['sources'],
89+
dependencies: [arrow_test_dep],
90+
)
91+
test(key, exc)
92+
endforeach
93+
94+
# TODO: benchmarks

‎cpp/src/arrow/compute/meson.build

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
# TODO: arrow_install_all_headers
19+
# TODO: add_pkg_config
20+
21+
arrow_compute_objlibs = []
22+
23+
# TODO: the CMake configuration builds test_util_internal.cc
24+
# as an object library, but it still requires the gtest dependency
25+
# In Meson, the gtest dependency being declared here then transists
26+
# down to libraries that try to use this, causing all of the symbols
27+
# to be duplicated. For now, we are just adding test_util_internal.cc
28+
# to the appropriate sources as a workaround
29+
'''
30+
if needs_testing
31+
arrow_compute_testing_lib = static_library(
32+
'arrow_compute_testing',
33+
sources: ['test_util_internal.cc'],
34+
include_directories: [include_dir],
35+
build_by_default: false,
36+
)
37+
arrow_compute_objlibs += arrow_compute_testing_lib.extract_all_objects(recursive: true)
38+
endif
39+
'''
40+
compute_test_util_srcs = ['test_util_internal.cc']
41+
42+
tests = {
43+
'arrow-internals-test': {
44+
'sources': [
45+
'function_test.cc',
46+
'exec_test.cc',
47+
'kernel_test.cc',
48+
'registry_test.cc',
49+
],
50+
},
51+
}
52+
53+
if needs_compute
54+
tests += {
55+
'arrow-compute-expression-test': {'sources': ['expression_test.cc']},
56+
'arrow-compute-row-test': {
57+
'sources': compute_test_util_srcs + [
58+
'key_hash_test.cc',
59+
'light_array_test.cc',
60+
'row/compare_test.cc',
61+
'row/grouper_test.cc',
62+
'row/row_encoder_internal_test.cc',
63+
'row/row_test.cc',
64+
'util_internal_test.cc',
65+
],
66+
},
67+
}
68+
endif
69+
70+
foreach key, val : tests
71+
exc = executable(
72+
key,
73+
sources: val['sources'],
74+
dependencies: [arrow_test_dep],
75+
)
76+
test(key, exc)
77+
endforeach
78+
79+
# add_arrow_benchmark(function_benchmark)
80+
81+
subdir('kernels')
82+
subdir('row')
83+

‎cpp/src/arrow/compute/row/meson.build

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
# TODO: arrow_install_all_headers
19+
20+
# TODO: add_arrow_benchmark(grouper_benchmark)

‎cpp/src/arrow/extension/meson.build

+31
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+
extension_test_srcs = ['bool8_test.cc', 'json_test.cc', 'uuid_test.cc']
19+
20+
if needs_json
21+
extension_test_srcs += ['fixed_shape_tensor_test.cc', 'opaque_test.cc']
22+
endif
23+
24+
extension_exc = executable(
25+
key,
26+
sources: extension_test_srcs,
27+
dependencies: [arrow_test_dep],
28+
)
29+
test('arrow-canonical-extensions', extension_exc)
30+
31+
# TODO: arrow_install_all_headers

‎cpp/src/arrow/integration/meson.build

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
# TODO: arrow_install_all_headers
19+
20+
if needs_tests
21+
gflags_dep = dependency('gflags')
22+
tests = {
23+
'arrow-json-integration-test': {'sources': ['json_integration_test.cc']},
24+
}
25+
# elif needs_integration
26+
# TODO: this test currently seems broken as it defines its own
27+
# copy of main, which conflicts with gtest_main
28+
'''
29+
foreach key, val : tests
30+
exc = executable(
31+
key,
32+
sources: val['sources'],
33+
dependencies: [arrow_test_dep, gflags_dep],
34+
)
35+
test(key, exc)
36+
endforeach
37+
'''
38+
endif
39+
# add_arrow_benchmark(bridge_benchmark)
40+

‎cpp/src/arrow/io/meson.build

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
tests = {
19+
'arrow-io-buffered-test': {'sources': ['buffered_test.cc']},
20+
'arrow-io-compressed-test': {'sources': ['compressed_test.cc']},
21+
'arrow-io-file-test': {'sources': ['file_test.cc']},
22+
'arrow-io-memory-test': {'sources': ['memory_test.cc']},
23+
}
24+
25+
# if needs_hdfs
26+
# ...
27+
#
28+
29+
foreach key, val : tests
30+
exc = executable(
31+
key,
32+
sources: val['sources'],
33+
dependencies: [arrow_test_dep],
34+
implicit_include_directories: false, # stdio.h conflicts with stdlib
35+
)
36+
test(key, exc)
37+
endforeach
38+
39+
# TODO: benchmarks
40+
# TODO: arrow_install_all_headers

‎cpp/src/arrow/ipc/meson.build

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
# TODO: arrow_install_all_headers
19+
20+
if needs_tests
21+
tests = {
22+
'arrow-feather-test': {
23+
'sources': ['feather_test.cc'],
24+
'include_dir': [],
25+
},
26+
'arrow-ipc-json-simple-test': {
27+
'sources': ['json_simple_test.cc'],
28+
'include_dir': [],
29+
},
30+
'arrow-ipc-message-internal-test': {
31+
'sources': ['message_internal_test.cc'],
32+
'include_dir': [
33+
include_directories('../../../thirdparty/flatbuffers/include'),
34+
],
35+
},
36+
'arrow-ipc-read-write-test': {
37+
'sources': ['read_write_test.cc'],
38+
'include_dir': [
39+
include_directories('../../../thirdparty/flatbuffers/include'),
40+
],
41+
},
42+
'arrow-ipc-tensor-test': {
43+
'sources': ['tensor_test.cc'],
44+
'include_dir': [],
45+
},
46+
}
47+
48+
foreach key, val : tests
49+
exc = executable(
50+
key,
51+
sources: val['sources'],
52+
include_directories: val['include_dir'],
53+
dependencies: [arrow_test_dep],
54+
)
55+
test(key, exc)
56+
endforeach
57+
endif
58+
59+
# TODO: integrations and utilities
60+
# TODO: fuzzing

‎cpp/src/arrow/json/meson.build

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
# TODO: arrow_install_all_headers
19+
# TODO: pkgconfig
20+
21+
if needs_tests
22+
tests = {
23+
'arrow-json-test': {
24+
'sources': [
25+
'chunked_builder_test.cc',
26+
'chunker_test.cc',
27+
'converter_test.cc',
28+
'parser_test.cc',
29+
'reader_test.cc',
30+
],
31+
},
32+
}
33+
34+
foreach key, val : tests
35+
exc = executable(
36+
key,
37+
sources: val['sources'],
38+
dependencies: [arrow_test_dep],
39+
)
40+
test(key, exc)
41+
endforeach
42+
endif

‎cpp/src/arrow/meson.build

+456
Large diffs are not rendered by default.

‎cpp/src/arrow/tensor/meson.build

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
# TODO: arrow_install_all_headers
19+
# TODO: benchmarks

‎cpp/src/arrow/testing/meson.build

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
# TODO: arrow_install_all_headers equivalent
19+
20+
if needs_tests
21+
tests = {
22+
'arrow-random-test': {'sources': ['random_test.cc']},
23+
'arrow-gtest-util-test': {'sources': ['gtest_util_test.cc']},
24+
}
25+
26+
foreach key, val : tests
27+
exc = executable(
28+
key,
29+
sources: val['sources'],
30+
dependencies: [arrow_test_dep],
31+
)
32+
test(key, exc)
33+
endforeach
34+
35+
# if needs_filesystem
36+
# ...
37+
# endif
38+
endif

‎cpp/src/arrow/util/meson.build

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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+
# arrow_install_all_headers
19+
20+
conf_data = configuration_data()
21+
22+
version = meson.project_version()
23+
# Remove any pre-release / build identifiers
24+
version_no_pre_release = version.split('-')[0]
25+
version_no_build = version_no_pre_release.split('+')[0]
26+
components = version_no_build.split('.')
27+
assert(
28+
components.length() >= 3,
29+
'The version does not contain major, minor and patch',
30+
)
31+
ver_major = components[0]
32+
ver_minor = components[1]
33+
ver_patch = components[2]
34+
conf_data.set('ARROW_VERSION_MAJOR', ver_major)
35+
conf_data.set('ARROW_VERSION_MINOR', ver_minor)
36+
conf_data.set('ARROW_VERSION_PATCH', ver_patch)
37+
38+
conf_data.set('ARROW_VERSION_STRING', version)
39+
40+
# conf_data.set('ARROW_SO_VERSION', ...)
41+
# conf_data.set('ARROW_FULL_SO_VERSION', ...)
42+
43+
# conf_data.set('ARROW_CXX_COMPILER_ID', ...)
44+
# conf_data.set('ARROW_CXX_COMPILER_VERSION', ...)
45+
# conf_data.set('ARROW_CXX_COMPILER_FLAGS', ...)
46+
47+
conf_data.set('UPPERCASE_BUILD_TYPE', get_option('buildtype').to_upper())
48+
49+
# conf_data.set('ARROW_PACKAGE_KIND', ...)
50+
51+
configure_file(
52+
input: 'config.h.cmake',
53+
output: 'config.h',
54+
configuration: conf_data,
55+
# https://mesonbuild.com/Reference-manual_functions.html#arguments13
56+
# TODO: need to bridge #cmakedefines somehow
57+
format: 'cmake@',
58+
install: true,
59+
install_dir: '.',
60+
)
61+
62+
internal_conf_data = configuration_data()
63+
64+
# internal_conf_data.set('ARROW_GIT_ID', ...)
65+
# internal_conf_data.set('ARROW_GIT_DESCRIPTION', ...)
66+
67+
configure_file(
68+
input: 'config_internal.h.cmake',
69+
output: 'config_internal.h',
70+
configuration: internal_conf_data,
71+
# https://mesonbuild.com/Reference-manual_functions.html#arguments13
72+
# TODO: need to bridge #cmakedefines somehow
73+
format: 'cmake@',
74+
install: true,
75+
install_dir: '.',
76+
)
77+
78+
io_util_test_sources = ['io_util_test.cc']
79+
if meson.get_compiler('cpp').get_id() == 'msvc'
80+
io_util_test_sources += ['io_util_test.manifest']
81+
elif host_machine.system() == 'windows'
82+
io_util_test_sources += ['io_util_test.rc']
83+
endif
84+
85+
if needs_tests
86+
util_tests = [
87+
'align_util_test.cc',
88+
'atfork_test.cc',
89+
'byte_size_test.cc',
90+
'byte_stream_split_test.cc',
91+
'cache_test.cc',
92+
'checked_cast_test.cc',
93+
'compression_test.cc',
94+
'decimal_test.cc',
95+
'float16_test.cc',
96+
'fixed_width_test.cc',
97+
'formatting_util_test.cc',
98+
'key_value_metadata_test.cc',
99+
'hashing_test.cc',
100+
'int_util_test.cc',
101+
] + io_util_test_sources + [
102+
'iterator_test.cc',
103+
'list_util_test.cc',
104+
'logger_test.cc',
105+
'logging_test.cc',
106+
'queue_test.cc',
107+
'range_test.cc',
108+
'ree_util_test.cc',
109+
'reflection_test.cc',
110+
'rows_to_batches_test.cc',
111+
'small_vector_test.cc',
112+
'span_test.cc',
113+
'stl_util_test.cc',
114+
'string_test.cc',
115+
'tdigest_test.cc',
116+
'test_common.cc',
117+
'time_test.cc',
118+
'tracing_test.cc',
119+
'trie_test.cc',
120+
'uri_test.cc',
121+
'utf8_util_test.cc',
122+
'value_parsing_test.cc',
123+
]
124+
tests = {
125+
126+
'arrow-bit-utility-test': {
127+
'sources': [
128+
'bit_block_counter_test.cc',
129+
'bit_util_test.cc',
130+
'rle_encoding_test.cc',
131+
],
132+
},
133+
}
134+
135+
foreach key, val : tests
136+
exc = executable(
137+
key,
138+
sources: val['sources'],
139+
dependencies: [arrow_test_dep],
140+
implicit_include_directories: false, # algorithm.h conflicts with stdlib
141+
)
142+
test(key, exc)
143+
endforeach
144+
endif
145+
146+
# TODO: add_benchmarks

0 commit comments

Comments
 (0)
Please sign in to comment.