Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project(
'cpp',
version: '0.8.0-SNAPSHOT',
license: 'Apache 2.0',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPDX license expression is preferred.

Suggested change
license: 'Apache 2.0',
license: 'Apache-2.0',

meson_version: '>=1.3.0',
meson_version: '>=1.1.0',
Copy link
Contributor Author

@WillAyd WillAyd Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Meson team advises against artificially raising the version requirement, so that as many people can use the wrap as possible.

We require version 1.1.0 because we have meson.options in the root. If we were to rename that to meson_options.txt, we could go even further back.

With that said, 1.1.0 came out in April 2023, so I think its a reasonable enough floor for now

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meson.options is undoubtedly a nicer name but IMO it's not worth constraining the Meson version just to avoid meson_options.txt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger that - dropped to 0.58 as a minimum then, which we need for str.replace in the config

default_options: ['c_std=c99', 'warning_level=2', 'cpp_std=c++17'],
)

Expand Down Expand Up @@ -91,12 +91,20 @@ nanoarrow_lib = library(
gnu_symbol_visibility: 'hidden',
)

pkg = import('pkgconfig')
pkg.generate(
nanoarrow_lib,
description: 'Helpers for Arrow C Data & Arrow C Stream interfaces',
)

nanoarrow_dep = declare_dependency(
include_directories: [incdir],
link_with: nanoarrow_lib,
compile_args: nanoarrow_dep_args,
)

meson.override_dependency('nanoarrow', nanoarrow_dep)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In today's wrap we have a provides section that looks like:

[provides]
nanoarrow = nanoarrow_dep
nanoarrow_ipc = nanoarrow_ipc_dep

But since Meson version 0.54.0, they have advised that a project internally call meson.override_dependency instead, so that the project has total control over their variable naming. As such, on the next release of Meson, we can simplify our wrap entry to just:

[provides]
dependency_names = [nanoarrow, nanoarrow-ipc, ...]

and decouple the internal variable name from the wrap system


if get_option('ipc').enabled()
# flatcc does not export symbols in a way that works with
# MSVC compilers, so we force static linkage
Expand Down Expand Up @@ -135,11 +143,14 @@ if get_option('ipc').enabled()
c_args: ipc_lib_c_args,
gnu_symbol_visibility: 'hidden',
)
pkg.generate(nanoarrow_ipc_lib, filebase: 'nanoarrow-ipc')

nanoarrow_ipc_dep = declare_dependency(
include_directories: [incdir],
link_with: nanoarrow_ipc_lib,
dependencies: [nanoarrow_dep],
)
meson.override_dependency('nanoarrow-ipc', nanoarrow_dep)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meson.override_dependency('nanoarrow-ipc', nanoarrow_dep)
meson.override_dependency('nanoarrow-ipc', nanoarrow_ipc_dep)

zlib_dep = dependency('zlib', default_options: ['tests=disabled'])
else
flatcc_dep = disabler()
Expand Down Expand Up @@ -191,12 +202,14 @@ if needs_device
cpp_args: device_defines,
gnu_symbol_visibility: 'hidden',
)
pkg.generate(nanoarrow_device_lib, filebase: 'nanoarrow-device')

nanoarrow_device_dep = declare_dependency(
include_directories: [incdir],
link_with: nanoarrow_device_lib,
dependencies: device_deps,
)
meson.override_dependency('nanoarrow-device', nanoarrow_device_dep)
else
nanoarrow_device_dep = disabler()
endif
Expand All @@ -213,12 +226,14 @@ if needs_testing
install: true,
gnu_symbol_visibility: 'hidden',
)
pkg.generate(nanoarrow_testing_lib, filebase: 'nanoarrow-testing')

nanoarrow_testing_dep = declare_dependency(
include_directories: [incdir],
link_with: nanoarrow_testing_lib,
dependencies: [nanoarrow_dep, nlohmann_json_dep],
)
meson.override_dependency('nanoarrow-testing', nanoarrow_testing_dep)
else
nanoarrow_testing_dep = disabler()
endif
Expand Down Expand Up @@ -385,9 +400,3 @@ if get_option('apps').enabled()
dependencies: [nanoarrow_ipc_dep],
)
endif

pkg = import('pkgconfig')
pkg.generate(
nanoarrow_lib,
description: 'Helpers for Arrow C Data & Arrow C Stream interfaces',
)
Loading