1if get_option('gme').disabled()
2  subdir_done()
3endif
4
5have_gme = cc.has_header ('gme/gme.h')
6if have_gme
7  gme_dep = cc.find_library('gme', required: get_option('gme'))
8  have_gme = gme_dep.found()
9endif
10
11if have_gme
12  cdata.set('HAVE_LIBGME_ACCURACY', cc.has_function('gme_enable_accuracy', dependencies: gme_dep))
13  gstgme = library('gstgme', 'gstgme.c',
14    c_args: gst_plugins_bad_args,
15    include_directories: [configinc],
16    dependencies: [gstaudio_dep, gme_dep],
17    install: true,
18    install_dir: plugins_install_dir,
19  )
20  pkgconfig.generate(gstgme, install_dir: plugins_pkgconfig_install_dir)
21elif get_option('gme').enabled()
22  error('libgme plugin was enabled but required dependencies not found.')
23endif
24