| 1 |
project( |
| 2 |
'quote', |
| 3 |
'rust', |
| 4 |
version : '1.0.35', |
| 5 |
license : 'MIT OR Apache-2.0', |
| 6 |
meson_version : '>= 1.7.0', |
| 7 |
) |
| 8 |
|
| 9 |
rc = meson.get_compiler('rust') |
| 10 |
|
| 11 |
if rc.version().version_compare('< 1.31') |
| 12 |
error('Minimum rustc supported version is 1.31') |
| 13 |
endif |
| 14 |
|
| 15 |
rust_args = ['--cfg', 'feature="default"', '--cfg', 'feature="proc-macro"'] |
| 16 |
if rc.version().version_compare('< 1.53') |
| 17 |
rust_args += ['--cfg', 'needs_invalid_span_workaround'] |
| 18 |
endif |
| 19 |
|
| 20 |
pm2 = subproject('proc-macro2-1-rs').get_variable('lib') |
| 21 |
|
| 22 |
# XXX: workround for meson bug: https://github.com/mesonbuild/meson/issues/11306 |
| 23 |
rust_args += ['-L', 'dependency=subprojects/unicode-ident-1-rs'] |
| 24 |
|
| 25 |
lib = static_library( |
| 26 |
'quote', |
| 27 |
'src/lib.rs', |
| 28 |
rust_args : rust_args, |
| 29 |
override_options : ['rust_std=2018', 'build.rust_std=2018', 'warning_level=0'], |
| 30 |
link_with : pm2, |
| 31 |
rust_abi : 'rust', |
| 32 |
native : true, |
| 33 |
) |