summaryrefslogtreecommitdiff
path: root/examples/meson.build
blob: 7d75128b5959b14a317e1994fdc30010a6426e70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
if not meson.is_cross_build()

  if opt_tools.disabled() and opt_examples.enabled()
    error('Need to build tools (orcc) to build examples.')
  endif

  examples = ['example1', 'example2', 'example3', 'mt19937ar']

  foreach ex : examples

    orc_c = custom_target (ex + 'orc.c',
                           output : ex + 'orc.c',
                           input : files(ex + 'orc.orc'),
                           command : [orcc, '--include', 'stdint.h', '--implementation', '-o', '@OUTPUT@', '@INPUT@'])

    orc_h = custom_target (ex + 'orc.h',
                           output : ex + 'orc.h',
                           input : files(ex + 'orc.orc'),
                           command : [orcc, '--include', 'stdint.h', '--header', '-o', '@OUTPUT@', '@INPUT@'])

    executable (ex, ex + '.c', orc_h, orc_c,
                install: false,
                dependencies: [libm, orc_dep, orc_test_dep])

  endforeach

  if backend == 'mmx' or backend == 'all'
    executable ('volscale', 'volscale.c',
                install: false,
                dependencies: [libm, orc_dep, orc_test_dep])
  endif

endif # meson.is_cross_build()