Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 17 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ project(
'c',
'cpp',
version: '0.8.0-SNAPSHOT',
license: 'Apache 2.0',
meson_version: '>=1.3.0',
license: 'Apache-2.0',
meson_version: '>=0.58.0',
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_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',
)
File renamed without changes.
2 changes: 1 addition & 1 deletion python/generate_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def main():

subproj_dir.mkdir(parents=True)
shutil.copy(src_dir / "meson.build", subproj_dir / "meson.build")
shutil.copy(src_dir / "meson.options", subproj_dir / "meson.options")
shutil.copy(src_dir / "meson_options.txt", subproj_dir / "meson_options.txt")

# Copy over any subproject dependency / wrap files
subproj_subproj_dir = subproj_dir / "subprojects"
Expand Down
Loading