@@ -18,16 +18,16 @@ py_mod = import('python')
18
18
py = py_mod.find_installation()
19
19
py_dep = py.dependency ()
20
20
21
- robin_map_dep = dependency (' robin-map' )
21
+ robin_map_dep = dependency (
22
+ ' robin-map' ,
23
+ version : ' >=1.4.0' ,
24
+ )
22
25
23
26
incdir = include_directories (' include' )
24
27
25
28
# Arguments are derived from nanobind_build_library() in CMake configuration.
26
29
dep_compile_args = []
27
-
28
- if not get_option (' debug' )
29
- dep_compile_args += [' -DNB_COMPACT_ASSERTIONS' ]
30
- endif
30
+ dep_link_args = []
31
31
32
32
compiler = meson .get_compiler(' cpp' )
33
33
if compiler.get_argument_syntax() == ' msvc'
@@ -42,19 +42,26 @@ if freethreaded
42
42
dep_compile_args += [' -DNB_FREE_THREADED' ]
43
43
endif
44
44
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
+
48
57
if host_machine .system() == ' darwin'
49
58
py_soabi = py.get_variable (' SOABI' )
50
59
if py_soabi.startswith(' cp' )
51
60
resp_file = meson .project_source_root() / ' cmake/darwin-ld-cpython.sym'
52
61
else
53
62
resp_file = meson .project_source_root() / ' cmake/darwin-ld-pypy.sym'
54
63
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]
58
65
endif
59
66
60
67
if get_option (' default_library' ) == ' shared'
@@ -89,4 +96,7 @@ nanobind_dep = declare_dependency(
89
96
dependencies : [py_dep, robin_map_dep],
90
97
compile_args : dep_compile_args,
91
98
link_args : dep_link_args,
99
+ variables : {
100
+ ' stubgen' : meson .current_source_dir() / ' src/stubgen.py' ,
101
+ },
92
102
)
0 commit comments