Minor Python module installation tweak
[jack_mixer.git] / src / meson.build
blob0f680b21225a51558a0fd489dabb90fd52fd0da4
1 jack_mixer_sources = files([
2     'jack_mixer.c',
3     'log.c',
4     'scale.c'
5 ])
7 jack_mixer_inc = include_directories('.')
10 # Build 'jack_mix_box' command line program
11 executable(
12     'jack_mix_box',
13     ['jack_mix_box.c', jack_mixer_sources],
14     dependencies: [
15         glib_dep,
16         jack_dep,
17         math_dep
18     ],
19     include_directories: jack_mixer_inc,
20     c_args: get_option('jack-midi').enabled() ? '-DHAVE_JACK_MIDI' : [],
21     install: true,
25 # Generate extension module C source from Cython sources
26 if get_option('gui').enabled()
27     fs = import('fs')
29     jack_mixer_mod_pyx = '_jack_mixer.pyx'
30     jack_mixer_mod_c = '_jack_mixer.c'
32     cython = find_program('cython', required: false)
34     if fs.exists(jack_mixer_mod_c)
35         jack_mixer_cython = files(jack_mixer_mod_c)
36     elif cython.found()
37         jack_mixer_mod_pxd = '_jack_mixer.pxd'
39         jack_mixer_cython = custom_target(
40             'jack_mixer_cython',
41             output: jack_mixer_mod_c,
42             input: jack_mixer_mod_pyx,
43             depend_files: [jack_mixer_mod_pyx, jack_mixer_mod_pxd],
44             command: [cython, '-o', '@OUTPUT@', '@INPUT@'],
45         )
46     else
47         error('The \'cython\' program was not found but is required.\n' +
48               'Please install Cython from: https://pypi.org/project/Cython/.')
49     endif
51     meson.add_dist_script('meson_dist_cython.py', jack_mixer_mod_c)
52 endif