2023-01-30 20:53:18 -06:00
|
|
|
project(
|
|
|
|
|
'quote',
|
|
|
|
|
'rust',
|
2024-12-18 14:46:25 -08:00
|
|
|
version : '1.0.35',
|
2025-06-11 10:03:16 -07:00
|
|
|
license : 'MIT OR Apache-2.0',
|
2023-01-30 20:53:18 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
rc = meson.get_compiler('rust')
|
|
|
|
|
|
|
|
|
|
if rc.version().version_compare('< 1.31')
|
|
|
|
|
error('Minimum rustc supported version is 1.31')
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
rust_args = ['--cfg', 'feature="default"', '--cfg', 'feature="proc-macro"']
|
|
|
|
|
if rc.version().version_compare('< 1.53')
|
|
|
|
|
rust_args += ['--cfg', 'needs_invalid_span_workaround']
|
|
|
|
|
endif
|
|
|
|
|
|
2025-07-22 08:43:52 +02:00
|
|
|
pm2 = subproject('proc-macro2-1-rs').get_variable('lib')
|
2023-01-30 20:53:18 -06:00
|
|
|
|
|
|
|
|
# XXX: workround for meson bug: https://github.com/mesonbuild/meson/issues/11306
|
2025-07-22 08:43:52 +02:00
|
|
|
rust_args += ['-L', 'dependency=subprojects/unicode-ident-1-rs']
|
2023-01-30 20:53:18 -06:00
|
|
|
|
|
|
|
|
lib = static_library(
|
|
|
|
|
'quote',
|
|
|
|
|
'src/lib.rs',
|
|
|
|
|
rust_args : rust_args,
|
|
|
|
|
override_options : ['rust_std=2018', 'build.rust_std=2018'],
|
|
|
|
|
link_with : pm2,
|
|
|
|
|
rust_abi : 'rust',
|
|
|
|
|
native : true,
|
|
|
|
|
)
|