1soundtouch_sources = [
2  'plugin.c',
3  'gstpitch.cc',
4  'gstbpmdetect.cc',
5]
6
7soundtouch_cargs = ['-DHAVE_SOUNDTOUCH']
8if get_option('soundtouch').disabled()
9  subdir_done()
10endif
11
12if not gnustl_dep.found() and get_option('soundtouch').enabled()
13  error('soundtouch plugin enabled but could not find gnustl dep for Android c++ support')
14endif
15
16soundtouch_dep = dependency('soundtouch', required : false)
17if soundtouch_dep.found()
18  soundtouch_cargs += ['-DHAVE_SOUNDTOUCH_1_4']
19else
20  soundtouch_dep = dependency('soundtouch-1.4', required : false)
21  if soundtouch_dep.found()
22    soundtouch_cargs += ['-DHAVE_SOUNDTOUCH_1_4']
23  else
24    soundtouch_dep = dependency('soundtouch-1.0', required : false)
25    # NOTE: I removed the checks for libSoundTouch.pc and so on.
26    # Add them back once we know which distros use them.
27  endif
28endif
29if not soundtouch_dep.found() and get_option('soundtouch').enabled()
30  error('soundtouch plugin enabled but soundtouch library not found')
31endif
32
33if soundtouch_dep.found()
34  gstsoundtouch = library('gstsoundtouch',
35    soundtouch_sources,
36    c_args : gst_plugins_bad_args + soundtouch_cargs,
37    cpp_args : gst_plugins_bad_args + soundtouch_cargs,
38    include_directories : [configinc],
39    dependencies : [gstaudio_dep, soundtouch_dep, gnustl_dep],
40    install : true,
41    install_dir : plugins_install_dir)
42  pkgconfig.generate(gstsoundtouch, install_dir : plugins_pkgconfig_install_dir)
43endif
44