@@ -18,16 +18,16 @@ py_mod = import('python')
1818py = py_mod.find_installation()
1919py_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
2326incdir = include_directories (' include' )
2427
2528# Arguments are derived from nanobind_build_library() in CMake configuration.
2629dep_compile_args = []
27-
28- if not get_option (' debug' )
29- dep_compile_args += [' -DNB_COMPACT_ASSERTIONS' ]
30- endif
30+ dep_link_args = []
3131
3232compiler = meson .get_compiler(' cpp' )
3333if compiler.get_argument_syntax() == ' msvc'
@@ -42,19 +42,26 @@ if freethreaded
4242 dep_compile_args += [' -DNB_FREE_THREADED' ]
4343endif
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+
4857if 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]
5865endif
5966
6067if 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