This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new a583e6ab10 GH-46091: [C++] Use feature options in Meson configuration
(#46204)
a583e6ab10 is described below
commit a583e6ab100bc8b77190c7be5105d955b12450f1
Author: William Ayd <[email protected]>
AuthorDate: Wed Apr 23 03:19:43 2025 -0400
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]>
---
ci/scripts/cpp_build.sh | 4 ++-
cpp/meson.build | 24 +++++++-------
cpp/meson.options | 86 +++++++++----------------------------------------
3 files changed, 30 insertions(+), 84 deletions(-)
diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh
index 0ed229517f..b6ee261218 100755
--- a/ci/scripts/cpp_build.sh
+++ b/ci/scripts/cpp_build.sh
@@ -121,7 +121,9 @@ if [ "${ARROW_USE_MESON:-OFF}" = "ON" ]; then
meson setup \
--prefix=${MESON_PREFIX:-${ARROW_HOME}} \
--buildtype=${ARROW_BUILD_TYPE:-debug} \
- -Dtests=$(meson_boolean ${ARROW_BUILD_TESTS:-OFF}) \
+ -Dauto_features=enabled \
+ -Dgcs=disabled \
+ -Ds3=disabled \
. \
${source_dir}
elif [ "${ARROW_EMSCRIPTEN:-OFF}" = "ON" ]; then
diff --git a/cpp/meson.build b/cpp/meson.build
index 2b633cf7ad..a2ea03ce56 100644
--- a/cpp/meson.build
+++ b/cpp/meson.build
@@ -56,17 +56,17 @@ if git_description == ''
git_description = run_command('git', 'describe', '--tags', check:
false).stdout().strip()
endif
-needs_benchmarks = get_option('benchmarks')
-needs_csv = get_option('csv')
-needs_azure = get_option('azure')
-needs_gcs = get_option('gcs')
-needs_hdfs = get_option('hdfs')
-needs_s3 = get_option('s3')
-needs_filesystem = get_option('filesystem') or needs_azure or needs_gcs or
needs_hdfs or needs_s3
-needs_integration = get_option('integration')
-needs_tests = get_option('tests')
-needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks
-needs_testing = get_option('testing') or needs_tests or needs_benchmarks or
needs_integration
-needs_json = get_option('json') or needs_testing
+needs_benchmarks = get_option('benchmarks').enabled()
+needs_csv = get_option('csv').enabled()
+needs_azure = get_option('azure').enabled()
+needs_gcs = get_option('gcs').enabled()
+needs_hdfs = get_option('hdfs').enabled()
+needs_s3 = get_option('s3').enabled()
+needs_filesystem = get_option('filesystem').enabled() or needs_azure or
needs_gcs or needs_hdfs or needs_s3
+needs_integration = get_option('integration').enabled()
+needs_tests = get_option('tests').enabled()
+needs_ipc = get_option('ipc').enabled() or needs_tests or needs_benchmarks
+needs_testing = get_option('testing').enabled() or needs_tests or
needs_benchmarks or needs_integration
+needs_json = get_option('json').enabled() or needs_testing
subdir('src/arrow')
diff --git a/cpp/meson.options b/cpp/meson.options
index 3641a7452d..d3c1833ad2 100644
--- a/cpp/meson.options
+++ b/cpp/meson.options
@@ -17,76 +17,33 @@
option(
'azure',
- type: 'boolean',
+ type: 'feature',
description: 'Build Arrow with Azure support (requires the Azure SDK for
C++)',
- value: false,
)
-option(
- 'benchmarks',
- type: 'boolean',
- description: 'Build the Arrow micro benchmarks',
- value: false,
-)
-
-option(
- 'csv',
- type: 'boolean',
- description: 'Build the Arrow CSV Parser Module',
- value: false,
-)
-
-option(
- 'filesystem',
- type: 'boolean',
- description: 'Build the Arrow Filesystem Layer',
- value: false,
-)
+option('benchmarks', type: 'feature', description: 'Build the Arrow micro
benchmarks')
+option('csv', type: 'feature', description: 'Build the Arrow CSV Parser
Module')
+option('filesystem', type: 'feature', description: 'Build the Arrow Filesystem
Layer')
option(
'gcs',
- type: 'boolean',
+ type: 'feature',
description: 'Build Arrow with GCS support (requires the Google Cloud
Platform C++ Client Libraries)',
- value: false,
)
-option(
- 'hdfs',
- type: 'boolean',
- description: 'Build the Arrow HDFS bridge',
- value: false,
-)
-
-option(
- 'integration',
- type: 'boolean',
- description: 'Build the Arrow integration test executables',
- value: false,
-)
+option('hdfs', type: 'feature', description: 'Build the Arrow HDFS bridge')
+option('integration', type: 'feature', description: 'Build the Arrow
integration test executables')
option(
'ipc',
- type: 'boolean',
+ type: 'feature',
description: 'Build the Arrow IPC extensions',
- value: true,
+ value: 'enabled',
)
-option(
- 'json',
- type: 'boolean',
- description: 'Build Arrow with JSON support',
- value: false,
-)
-
-option(
- 'git_id',
- type: 'string',
-)
-
-option(
- 'git_description',
- type: 'string',
-)
+option('json', type: 'feature', description: 'Build Arrow with JSON support')
+option('git_id', type: 'string')
+option('git_description', type: 'string')
option(
'package_kind',
@@ -96,21 +53,8 @@ option(
option(
's3',
- type: 'boolean',
+ type: 'feature',
description: 'Build Arrow with S3 support (requires the AWS SDK for C++)',
- value: false,
-)
-
-option(
- 'testing',
- type: 'boolean',
- description: 'Build the Arrow testing libraries',
- value: false,
-)
-
-option(
- 'tests',
- type: 'boolean',
- description: 'Build the Arrow googletest unit tests',
- value: false,
)
+option('testing', type: 'feature', description: 'Build the Arrow testing
libraries')
+option('tests', type: 'feature', description: 'Build the Arrow googletest unit
tests')