1
1
project (' mpv' ,
2
- ' c' ,
2
+ [ ' c' , ' rust ' ] ,
3
3
license : [' GPL2+' , ' LGPL2.1+' ],
4
4
version : files (' ./MPV_VERSION' ),
5
5
meson_version : ' >=1.3.0' ,
@@ -11,6 +11,8 @@ project('mpv',
11
11
' cpp_std=c++20' ,
12
12
' cpp_eh=default' ,
13
13
' warning_level=2' ,
14
+ ' rust_std=2021' ,
15
+ ' build.rust_std=2021' ,
14
16
]
15
17
)
16
18
@@ -1761,6 +1763,13 @@ major = client_h_define.split('|')[0].split('<<')[0].strip('() ')
1761
1763
minor = client_h_define.split(' |' )[1 ].strip(' () ' )
1762
1764
client_api_version = major + ' .' + minor + ' .0'
1763
1765
1766
+ tempfile_dep = dependency (' tempfile' , fallback : [' tempfile' , ' tempfile_dep' ])
1767
+ libmpv_rs = static_library (' libmpv_rs' ,
1768
+ ' misc/io_utils.rs' ,
1769
+ rust_abi : ' c' ,
1770
+ dependencies : tempfile_dep
1771
+ )
1772
+
1764
1773
libmpv = library (' mpv' , sources, dependencies : dependencies, gnu_symbol_visibility : ' hidden' ,
1765
1774
link_args : cc.get_supported_link_arguments([' -Wl,-Bsymbolic' ]),
1766
1775
version : client_api_version, install : get_option (' libmpv' ),
@@ -1777,7 +1786,7 @@ if get_option('libmpv')
1777
1786
install_headers (headers, subdir : ' mpv' )
1778
1787
1779
1788
# Allow projects to build with libmpv by cloning into ./subprojects/mpv
1780
- libmpv_dep = declare_dependency (link_with : libmpv)
1789
+ libmpv_dep = declare_dependency (link_with : [ libmpv, libmpv_rs] )
1781
1790
meson .override_dependency(' mpv' , libmpv_dep)
1782
1791
endif
1783
1792
@@ -1810,7 +1819,7 @@ if get_option('cplayer')
1810
1819
install_data (' etc/mpv-symbolic.svg' , install_dir : join_paths (hicolor_dir, ' symbolic' , ' apps' ))
1811
1820
1812
1821
mpv = executable (' mpv' , main_fn_source, objects : libmpv.extract_all_objects(recursive : true ), dependencies : dependencies,
1813
- win_subsystem : get_option (' win32-subsystem' ), install : true )
1822
+ link_with : libmpv_rs, win_subsystem : get_option (' win32-subsystem' ), install : true )
1814
1823
1815
1824
if win32 and get_option (' win32-subsystem' ) != ' console'
1816
1825
wrapper_sources= ' osdep/win32-console-wrapper.c'
0 commit comments