add meson support

This commit is contained in:
John Turner
2025-11-15 21:08:39 +00:00
parent c0bd0c9efd
commit fdf1f09d6f
7 changed files with 63 additions and 212 deletions

View File

@@ -0,0 +1,31 @@
project(
'thiserror',
'rust',
version: '2.0.17',
meson_version: '>=1.9.1',
default_options: {
'rust_std': '2024',
'rust_nightly': 'enabled',
'rust_edition': 2024,
},
)
rust = import('rust')
syn = dependency('syn-2-rs')
proc_macro2 = dependency('proc-macro2-1-rs')
quote = dependency('quote-1-rs')
thiserror_proc_macro = rust.proc_macro(
'thiserror_impl',
'impl/src/lib.rs',
dependencies: [syn, proc_macro2, quote],
)
thiserror = static_library(
'thiserror',
'src/lib.rs',
rust_args: ['--cfg', 'feature="std"'],
link_with: [thiserror_proc_macro],
)