meson: don't error out if sidplay library is not found
[platform/upstream/gstreamer.git] / ext / sidplay / meson.build
1 # sidplay plugin works with libsidplay 1.36.x (not 2.x.x)
2 have_sidplay = false
3 if add_languages('cpp')
4   cxx = meson.get_compiler('cpp')
5
6   if cxx.has_header('sidplay/player.h')
7     sid_code = '''#include <sidplay/player.h>
8                   void somefunc (void) {
9                     sidTune tune = sidTune(0);
10                   }'''
11     sidplay_dep = cxx.find_library('sidplay', required: false)
12     if sidplay_dep.found()
13       have_sidplay = cxx.compiles(sid_code, dependencies: sidplay_dep, name : 'sidplay')
14     endif
15   endif
16 endif
17
18 if have_sidplay
19   shared_module('gstsid', 'gstsiddec.cc',
20     cpp_args : ugly_args,
21     include_directories : [configinc],
22     dependencies : [gstaudio_dep, sidplay_dep],
23     install : true,
24     install_dir : plugins_install_dir)
25 endif