| 1 |
project('custom target input extracted objects', 'c') |
| 2 |
|
| 3 |
if meson.backend() == 'xcode' |
| 4 |
error('MESON_SKIP_TEST: sometimes Xcode puts object files in weird paths and we cannot extract them.') |
| 5 |
endif |
| 6 |
|
| 7 |
|
| 8 |
checker = find_program('check_object.py') |
| 9 |
|
| 10 |
cc = meson.get_compiler('c').cmd_array().get(-1) |
| 11 |
|
| 12 |
subdir('libdir') |
| 13 |
|
| 14 |
custom_target('check', |
| 15 |
input: objlib.extract_objects('source.c'), |
| 16 |
output: 'objcheck', |
| 17 |
command: [checker, '1', '@OUTPUT@', '@INPUT@'], |
| 18 |
build_by_default: true) |
| 19 |
|
| 20 |
custom_target('checkct', |
| 21 |
input: objlib.extract_objects(ctsrc), |
| 22 |
output: 'objcheck-ct', |
| 23 |
command: [checker, '1', '@OUTPUT@', '@INPUT@'], |
| 24 |
build_by_default: true) |
| 25 |
|
| 26 |
custom_target('checkcti', |
| 27 |
input: objlib.extract_objects(ctsrc[0]), |
| 28 |
output: 'objcheck-cti', |
| 29 |
command: [checker, '1', '@OUTPUT@', '@INPUT@'], |
| 30 |
build_by_default: true) |
| 31 |
|
| 32 |
custom_target('checkgen', |
| 33 |
input: objlib.extract_objects(gensrc), |
| 34 |
output: 'objcheck-gen', |
| 35 |
command: [checker, '1', '@OUTPUT@', '@INPUT@'], |
| 36 |
build_by_default: true) |
| 37 |
|
| 38 |
custom_target('checkall', |
| 39 |
input: objlib.extract_all_objects(recursive: false), |
| 40 |
output: 'objcheck-all', |
| 41 |
command: [checker, '3', '@OUTPUT@', '@INPUT@'], |
| 42 |
build_by_default: true) |
| 43 |
|
| 44 |
custom_target('checkall-recursive', |
| 45 |
input: objlib.extract_all_objects(recursive: true), |
| 46 |
output: 'objcheck-all-recursive', |
| 47 |
command: [checker, '4', '@OUTPUT@', '@INPUT@'], |
| 48 |
build_by_default: true) |