| 1 |
project('rust proc-macro', 'rust') |
| 2 |
|
| 3 |
if build_machine.system() != 'linux' |
| 4 |
error('MESON_SKIP_TEST, this test only works on Linux. Patches welcome.') |
| 5 |
endif |
| 6 |
|
| 7 |
pm = shared_library( |
| 8 |
'proc_macro_examples', |
| 9 |
'proc.rs', |
| 10 |
rust_crate_type : 'proc-macro', |
| 11 |
) |
| 12 |
|
| 13 |
main = executable( |
| 14 |
'main', |
| 15 |
'use.rs', |
| 16 |
link_with : pm, |
| 17 |
rust_args : ['-C', 'panic=abort'], |
| 18 |
) |
| 19 |
|
| 20 |
test('main_test', main) |
| 21 |
|
| 22 |
rust = import('rust') |
| 23 |
|
| 24 |
pm = rust.proc_macro('proc_macro_examples2', 'proc.rs') |
| 25 |
|
| 26 |
main = executable( |
| 27 |
'main2', |
| 28 |
'use.rs', |
| 29 |
link_with : pm, |
| 30 |
rust_dependency_map : {'proc_macro_examples2' : 'proc_macro_examples'} |
| 31 |
) |
| 32 |
|
| 33 |
test('main_test2', main) |
| 34 |
|
| 35 |
subdir('subdir') |
| 36 |
|
| 37 |
staticlib = static_library('staticlib', 'lib.rs', |
| 38 |
link_with: pm_in_subdir, |
| 39 |
rust_dependency_map : {'proc_macro_examples3' : 'proc_macro_examples'} |
| 40 |
) |
| 41 |
|
| 42 |
executable('transitive-proc-macro', 'transitive-proc-macro.rs', |
| 43 |
link_with: staticlib, |
| 44 |
) |