Skip to content

Commit a583e6a

Browse files
authored
GH-46091: [C++] Use feature options in Meson configuration (#46204)
### Rationale for this change By changing from boolean options to feature options, we give users more flexibility to opt in or out of features in the Meson configuration ### What changes are included in this PR? All boolean options have been replaced by feature options ### Are these changes tested? Yes ### Are there any user-facing changes? No * GitHub Issue: #46091 Authored-by: Will Ayd <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 0cc4855 commit a583e6a

File tree

3 files changed

+30
-84
lines changed

3 files changed

+30
-84
lines changed

ci/scripts/cpp_build.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ if [ "${ARROW_USE_MESON:-OFF}" = "ON" ]; then
121121
meson setup \
122122
--prefix=${MESON_PREFIX:-${ARROW_HOME}} \
123123
--buildtype=${ARROW_BUILD_TYPE:-debug} \
124-
-Dtests=$(meson_boolean ${ARROW_BUILD_TESTS:-OFF}) \
124+
-Dauto_features=enabled \
125+
-Dgcs=disabled \
126+
-Ds3=disabled \
125127
. \
126128
${source_dir}
127129
elif [ "${ARROW_EMSCRIPTEN:-OFF}" = "ON" ]; then

cpp/meson.build

+12-12
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ if git_description == ''
5656
git_description = run_command('git', 'describe', '--tags', check: false).stdout().strip()
5757
endif
5858

59-
needs_benchmarks = get_option('benchmarks')
60-
needs_csv = get_option('csv')
61-
needs_azure = get_option('azure')
62-
needs_gcs = get_option('gcs')
63-
needs_hdfs = get_option('hdfs')
64-
needs_s3 = get_option('s3')
65-
needs_filesystem = get_option('filesystem') or needs_azure or needs_gcs or needs_hdfs or needs_s3
66-
needs_integration = get_option('integration')
67-
needs_tests = get_option('tests')
68-
needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks
69-
needs_testing = get_option('testing') or needs_tests or needs_benchmarks or needs_integration
70-
needs_json = get_option('json') or needs_testing
59+
needs_benchmarks = get_option('benchmarks').enabled()
60+
needs_csv = get_option('csv').enabled()
61+
needs_azure = get_option('azure').enabled()
62+
needs_gcs = get_option('gcs').enabled()
63+
needs_hdfs = get_option('hdfs').enabled()
64+
needs_s3 = get_option('s3').enabled()
65+
needs_filesystem = get_option('filesystem').enabled() or needs_azure or needs_gcs or needs_hdfs or needs_s3
66+
needs_integration = get_option('integration').enabled()
67+
needs_tests = get_option('tests').enabled()
68+
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
70+
needs_json = get_option('json').enabled() or needs_testing
7171

7272
subdir('src/arrow')

cpp/meson.options

+15-71
Original file line numberDiff line numberDiff line change
@@ -17,76 +17,33 @@
1717

1818
option(
1919
'azure',
20-
type: 'boolean',
20+
type: 'feature',
2121
description: 'Build Arrow with Azure support (requires the Azure SDK for C++)',
22-
value: false,
2322
)
2423

25-
option(
26-
'benchmarks',
27-
type: 'boolean',
28-
description: 'Build the Arrow micro benchmarks',
29-
value: false,
30-
)
31-
32-
option(
33-
'csv',
34-
type: 'boolean',
35-
description: 'Build the Arrow CSV Parser Module',
36-
value: false,
37-
)
38-
39-
option(
40-
'filesystem',
41-
type: 'boolean',
42-
description: 'Build the Arrow Filesystem Layer',
43-
value: false,
44-
)
24+
option('benchmarks', type: 'feature', description: 'Build the Arrow micro benchmarks')
25+
option('csv', type: 'feature', description: 'Build the Arrow CSV Parser Module')
26+
option('filesystem', type: 'feature', description: 'Build the Arrow Filesystem Layer')
4527

4628
option(
4729
'gcs',
48-
type: 'boolean',
30+
type: 'feature',
4931
description: 'Build Arrow with GCS support (requires the Google Cloud Platform C++ Client Libraries)',
50-
value: false,
5132
)
5233

53-
option(
54-
'hdfs',
55-
type: 'boolean',
56-
description: 'Build the Arrow HDFS bridge',
57-
value: false,
58-
)
59-
60-
option(
61-
'integration',
62-
type: 'boolean',
63-
description: 'Build the Arrow integration test executables',
64-
value: false,
65-
)
34+
option('hdfs', type: 'feature', description: 'Build the Arrow HDFS bridge')
35+
option('integration', type: 'feature', description: 'Build the Arrow integration test executables')
6636

6737
option(
6838
'ipc',
69-
type: 'boolean',
39+
type: 'feature',
7040
description: 'Build the Arrow IPC extensions',
71-
value: true,
41+
value: 'enabled',
7242
)
7343

74-
option(
75-
'json',
76-
type: 'boolean',
77-
description: 'Build Arrow with JSON support',
78-
value: false,
79-
)
80-
81-
option(
82-
'git_id',
83-
type: 'string',
84-
)
85-
86-
option(
87-
'git_description',
88-
type: 'string',
89-
)
44+
option('json', type: 'feature', description: 'Build Arrow with JSON support')
45+
option('git_id', type: 'string')
46+
option('git_description', type: 'string')
9047

9148
option(
9249
'package_kind',
@@ -96,21 +53,8 @@ option(
9653

9754
option(
9855
's3',
99-
type: 'boolean',
56+
type: 'feature',
10057
description: 'Build Arrow with S3 support (requires the AWS SDK for C++)',
101-
value: false,
102-
)
103-
104-
option(
105-
'testing',
106-
type: 'boolean',
107-
description: 'Build the Arrow testing libraries',
108-
value: false,
109-
)
110-
111-
option(
112-
'tests',
113-
type: 'boolean',
114-
description: 'Build the Arrow googletest unit tests',
115-
value: false,
11658
)
59+
option('testing', type: 'feature', description: 'Build the Arrow testing libraries')
60+
option('tests', type: 'feature', description: 'Build the Arrow googletest unit tests')

0 commit comments

Comments
 (0)