Skip to content

meson: Install Cargo-generated lib directly #450

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 2 commits into from
Mar 20, 2025
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
12 changes: 4 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ else
lib_path='target/release/wgpu_native.lib'
endif

#build by cargo
#build with cargo
run_command(cargo,'build','--release', check: true)
#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
)
#mark cargo artifact for installation
install_data(lib_path, install_dir : get_option('libdir'))

pkg = import('pkgconfig')
pkg.generate(name : 'wgpu-native',
description : 'Headers for using wgpu-native',
libraries : [wgpu_native],
libraries : ['-L${libdir}', '-lwgpu_native'],
version : meson.project_version(),
)
Loading