Skip to content

Commit ce7a761

Browse files
add meson.build (#84)
* add initial meson.build but some works may need for windows build * build on linux and windows * fix build on linux * add build support for freebsd netbsd openbsd ios macos android cygwin
1 parent 17cd1fd commit ce7a761

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

meson.build

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
project('wgpu-native', 'c', version : '0.6.0', license : 'MPL 2.0')
3+
4+
inc_dirs = [include_directories('ffi', is_system: true)]
5+
6+
cargo = find_program('cargo')
7+
#determin which dir contain platform library
8+
if ['linux','android','darwin','cygwin','freebsd','netbsd','openbsd'].contains(host_machine.system())
9+
lib_path='target/release/libwgpu_native.a'
10+
else
11+
lib_path='target/release/wgpu_native.lib'
12+
endif
13+
14+
#build by cargo
15+
run_command(cargo,'build','--release')
16+
#mark cargo artifact to static library
17+
wgpu_native = static_library('wgpu_native', objects : lib_path, install : true)
18+
19+
dep_wgpu_native = declare_dependency(
20+
link_with:wgpu_native,
21+
include_directories: inc_dirs
22+
)
23+
24+
pkg = import('pkgconfig')
25+
pkg.generate(name : 'wgpu-native',
26+
description : 'Headers for using wgpu-native',
27+
libraries : [wgpu_native],
28+
version : meson.project_version(),
29+
)
30+
install_subdir('include', install_dir : '')

0 commit comments

Comments
 (0)