Skip to content

Commit ee16cb4

Browse files
committed
GH-46375: [C++] Add adapters/orc directory to Meson
1 parent 697f501 commit ee16cb4

File tree

6 files changed

+98
-5
lines changed

6 files changed

+98
-5
lines changed

cpp/meson.build

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ or needs_fuzzing
7272
or needs_integration
7373
)
7474
needs_json = get_option('json').enabled() or needs_testing
75+
needs_orc = get_option('orc').enabled()
7576
needs_brotli = get_option('brotli').enabled() or needs_fuzzing
7677
needs_bz2 = get_option('bz2').enabled()
77-
needs_lz4 = get_option('lz4').enabled()
78-
needs_snappy = get_option('snappy').enabled()
79-
needs_zlib = get_option('zlib').enabled()
80-
needs_zstd = get_option('zstd').enabled()
78+
needs_lz4 = get_option('lz4').enabled() or needs_orc
79+
needs_snappy = get_option('snappy').enabled() or needs_orc
80+
needs_zlib = get_option('zlib').enabled() or needs_orc
81+
needs_zstd = get_option('zstd').enabled() or needs_orc
8182
needs_utilities = get_option('utilities').enabled()
8283

8384
subdir('src/arrow')

cpp/meson.options

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ option(
6868
description: 'Build with lz4 compression',
6969
)
7070

71+
option(
72+
'orc',
73+
type: 'feature',
74+
description: 'Build the Arrow ORC adapter',
75+
)
76+
7177
option(
7278
'package_kind',
7379
type: 'string',
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(['adapter.h', 'options.h'], subdir: 'arrow/adapters/orc')
19+
20+
arrow_orc_dep = declare_dependency(
21+
include_directories: include_directories('.'),
22+
dependencies: [arrow_dep],
23+
)
24+
25+
meson.override_dependency('arrow-orc', arrow_orc_dep)
26+
27+
pkg.generate(
28+
filebase: 'arrow-orc',
29+
name: 'Apache Arrow ORC',
30+
description: 'ORC modules for Apache Arrow',
31+
requires: ['arrow'],
32+
)
33+
34+
exc = executable(
35+
'arrow-orc-adapter-test',
36+
sources: ['adapter_test.cc'],
37+
dependencies: [arrow_test_dep, orc_dep],
38+
)
39+
test('arrow-orc-adapter-test', exc)

cpp/src/arrow/meson.build

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,22 @@ if needs_json
409409
}
410410
endif
411411

412+
if needs_orc
413+
orc_dep = dependency('orc')
414+
arrow_components += {
415+
'arrow_orc': {
416+
'sources': files(
417+
'adapters/orc/adapter.cc',
418+
'adapters/orc/options.cc',
419+
'adapters/orc/util.cc',
420+
),
421+
'dependencies': [orc_dep],
422+
},
423+
}
424+
else
425+
orc_dep = disabler()
426+
endif
427+
412428
arrow_srcs = []
413429
include_dir = include_directories('..')
414430
arrow_includes = [include_dir]
@@ -770,6 +786,10 @@ if needs_json
770786
subdir('json')
771787
endif
772788

789+
if needs_orc
790+
subdir('adapters/orc')
791+
endif
792+
773793
if needs_ipc
774794
subdir('ipc')
775795
endif

cpp/src/arrow/util/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ conf_data.set('ARROW_JEMALLOC', false)
4949
conf_data.set('ARROW_JEMALLOC_VENDORED', false)
5050
conf_data.set('ARROW_JSON', needs_json)
5151
conf_data.set('ARROW_MIMALLOC', false)
52-
conf_data.set('ARROW_ORC', false)
52+
conf_data.set('ARROW_ORC', needs_orc)
5353
conf_data.set('ARROW_PARQUET', false)
5454
conf_data.set('ARROW_SUBSTRAIT', false)
5555
conf_data.set('ARROW_AZURE', false)

cpp/subprojects/apache-orc.wrap

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
[wrap-file]
19+
directory = orc-2.2.0
20+
source_url = https://www.apache.org/dyn/closer.lua?action=download&filename=orc/orc-2.2.0/orc-2.2.0.tar.gz
21+
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/apache-orc_2.2.0-1/orc-2.2.0.tar.gz
22+
source_filename = orc-2.2.0.tar.gz
23+
source_hash = b15aca45a7e73ffbd1bbc36a78cd1422d41f07721092a25f43448e6e16f4763b
24+
wrapdb_version = 2.2.0-1
25+
26+
[provide]
27+
orc = orc_dep

0 commit comments

Comments
 (0)