Skip to content

Commit 7b6a129

Browse files
hpkfftbgilbert
authored andcommitted
Update nanobind to 2.8.0
Also, improve meson.build as follows: + Require robin-map version >=1.4.0 + Only strip output objects if not debug build + Add variable 'stubgen' to nanobind_dep
1 parent aefdf3d commit 7b6a129

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

releases.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,6 +2875,7 @@
28752875
"nanobind"
28762876
],
28772877
"versions": [
2878+
"2.8.0-1",
28782879
"2.7.0-4",
28792880
"2.7.0-3",
28802881
"2.7.0-2",

subprojects/nanobind.wrap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[wrap-file]
2-
directory = nanobind-2.7.0
3-
source_url = https://github.com/wjakob/nanobind/archive/refs/tags/v2.7.0.tar.gz
4-
source_filename = nanobind-2.7.0.tar.gz
5-
source_hash = 6c8c6bf0435b9d8da9312801686affcf34b6dbba142db60feec8d8e220830499
2+
directory = nanobind-2.8.0
3+
source_url = https://github.com/wjakob/nanobind/archive/refs/tags/v2.8.0.tar.gz
4+
source_filename = nanobind-2.8.0.tar.gz
5+
source_hash = 17506f1ef5c92491183ab28242fa4f658d9625fe4f91ccd1d1358cb6e5f5acb6
66
patch_directory = nanobind
77

88
[provide]

subprojects/packagefiles/nanobind/meson.build

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ py_mod = import('python')
1818
py = py_mod.find_installation()
1919
py_dep = py.dependency()
2020

21-
robin_map_dep = dependency('robin-map')
21+
robin_map_dep = dependency(
22+
'robin-map',
23+
version: '>=1.4.0',
24+
)
2225

2326
incdir = include_directories('include')
2427

2528
# Arguments are derived from nanobind_build_library() in CMake configuration.
2629
dep_compile_args = []
27-
28-
if not get_option('debug')
29-
dep_compile_args += ['-DNB_COMPACT_ASSERTIONS']
30-
endif
30+
dep_link_args = []
3131

3232
compiler = meson.get_compiler('cpp')
3333
if compiler.get_argument_syntax() == 'msvc'
@@ -42,19 +42,26 @@ if freethreaded
4242
dep_compile_args += ['-DNB_FREE_THREADED']
4343
endif
4444

45-
# The following, from nanobind_strip(), applies both to the nanobind shared
46-
# library (if it's built) and to the developer's extension:
47-
dep_link_args = []
45+
if not get_option('debug')
46+
dep_compile_args += ['-DNB_COMPACT_ASSERTIONS']
47+
48+
# The following, from nanobind_strip(), applies both to the nanobind shared
49+
# library (if it's built) and to the developer's extension:
50+
if host_machine.system() == 'darwin'
51+
dep_link_args += ['-Wl,-dead_strip', '-Wl,-x', '-Wl,-S']
52+
elif host_machine.system() != 'windows'
53+
dep_link_args += ['-Wl,-s']
54+
endif
55+
endif
56+
4857
if host_machine.system() == 'darwin'
4958
py_soabi = py.get_variable('SOABI')
5059
if py_soabi.startswith('cp')
5160
resp_file = meson.project_source_root() / 'cmake/darwin-ld-cpython.sym'
5261
else
5362
resp_file = meson.project_source_root() / 'cmake/darwin-ld-pypy.sym'
5463
endif
55-
dep_link_args += ['-Wl,-dead_strip', '-Wl,-x', '-Wl,-S', '-Wl,@' + resp_file]
56-
elif host_machine.system() != 'windows'
57-
dep_link_args += ['-Wl,-s']
64+
dep_link_args += ['-Wl,@' + resp_file]
5865
endif
5966

6067
if get_option('default_library') == 'shared'
@@ -89,4 +96,7 @@ nanobind_dep = declare_dependency(
8996
dependencies: [py_dep, robin_map_dep],
9097
compile_args: dep_compile_args,
9198
link_args: dep_link_args,
99+
variables: {
100+
'stubgen': meson.current_source_dir() / 'src/stubgen.py',
101+
},
92102
)

0 commit comments

Comments
 (0)