Skip to content

add meson.build #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

project('wgpu-native', 'c', version : '0.6.0', license : 'MPL 2.0')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we going to need to bump this version every time we update Cargo.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we provide version information for meson we need it


inc_dirs = [include_directories('ffi', is_system: true)]

cargo = find_program('cargo')
#determin which dir contain platform library
if ['linux','android','darwin','cygwin','freebsd','netbsd','openbsd'].contains(host_machine.system())
lib_path='target/release/libwgpu_native.a'
else
lib_path='target/release/wgpu_native.lib'
endif

#build by cargo
run_command(cargo,'build','--release')
#mark cargo artifact to static library
wgpu_native = static_library('wgpu_native', objects : lib_path, install : true)

dep_wgpu_native = declare_dependency(
link_with:wgpu_native,
include_directories: inc_dirs
)

pkg = import('pkgconfig')
pkg.generate(name : 'wgpu-native',
description : 'Headers for using wgpu-native',
libraries : [wgpu_native],
version : meson.project_version(),
)
install_subdir('include', install_dir : '')