| 1 |
if not meson.is_cross_build() |
| 2 |
|
| 3 |
if opt_tools.disabled() and opt_examples.enabled() |
| 4 |
error('Need to build tools (orcc) to build examples.') |
| 5 |
endif |
| 6 |
|
| 7 |
examples = ['example1', 'example2', 'example3', 'mt19937ar'] |
| 8 |
|
| 9 |
foreach ex : examples |
| 10 |
|
| 11 |
orc_c = custom_target (ex + 'orc.c', |
| 12 |
output : ex + 'orc.c', |
| 13 |
input : files(ex + 'orc.orc'), |
| 14 |
command : [orcc, '--include', 'stdint.h', '--implementation', '-o', '@OUTPUT@', '@INPUT@']) |
| 15 |
|
| 16 |
orc_h = custom_target (ex + 'orc.h', |
| 17 |
output : ex + 'orc.h', |
| 18 |
input : files(ex + 'orc.orc'), |
| 19 |
command : [orcc, '--include', 'stdint.h', '--header', '-o', '@OUTPUT@', '@INPUT@']) |
| 20 |
|
| 21 |
executable (ex, ex + '.c', orc_h, orc_c, |
| 22 |
install: false, |
| 23 |
dependencies: [libm, orc_dep, orc_test_dep]) |
| 24 |
|
| 25 |
endforeach |
| 26 |
|
| 27 |
if 'mmx' in enabled_targets or 'sse' in enabled_targets |
| 28 |
executable ('volscale', 'volscale.c', |
| 29 |
install: false, |
| 30 |
dependencies: [libm, orc_dep, orc_test_dep]) |
| 31 |
endif |
| 32 |
|
| 33 |
endif # meson.is_cross_build() |