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