| 1 |
sidplay_option = get_option('sidplay').require(gpl_allowed, error_message: ''' |
| 2 |
Plugin sidplay explicitly required via options but GPL-licensed plugins disabled via options. |
| 3 |
Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. |
| 4 |
''') |
| 5 |
|
| 6 |
sid_sources = [ |
| 7 |
'gstsiddec.cc', |
| 8 |
] |
| 9 |
|
| 10 |
sid_headers = [ |
| 11 |
'gstsiddec.h', |
| 12 |
] |
| 13 |
|
| 14 |
doc_sources = [] |
| 15 |
foreach s: sid_sources + sid_headers |
| 16 |
doc_sources += meson.current_source_dir() / s |
| 17 |
endforeach |
| 18 |
|
| 19 |
plugin_sources += { |
| 20 |
'sid': pathsep.join(doc_sources) |
| 21 |
} |
| 22 |
|
| 23 |
if not add_languages('cpp', native: false, required: sidplay_option) |
| 24 |
subdir_done() |
| 25 |
endif |
| 26 |
|
| 27 |
if not cxx.has_header('sidplay/player.h', required: sidplay_option) |
| 28 |
subdir_done() |
| 29 |
endif |
| 30 |
|
| 31 |
sidplay_dep = cxx.find_library('sidplay', required: sidplay_option) |
| 32 |
if not sidplay_dep.found() |
| 33 |
subdir_done() |
| 34 |
endif |
| 35 |
|
| 36 |
# sidplay plugin works with libsidplay 1.36.x (not 2.x.x) |
| 37 |
sid_code = '''#include <sidplay/player.h> |
| 38 |
void somefunc (void) { |
| 39 |
sidTune tune = sidTune(0); |
| 40 |
}''' |
| 41 |
if not cxx.compiles(sid_code, dependencies: sidplay_dep, name : 'sidplay usage') |
| 42 |
if sidplay_option.enabled() |
| 43 |
error('sidplay headers and libraries were found, but were not usable') |
| 44 |
endif |
| 45 |
subdir_done() |
| 46 |
endif |
| 47 |
|
| 48 |
gstsid = library('gstsid', |
| 49 |
sid_sources, |
| 50 |
cpp_args : ugly_args, |
| 51 |
include_directories : [configinc], |
| 52 |
dependencies : [gstaudio_dep, sidplay_dep], |
| 53 |
install : true, |
| 54 |
install_dir : plugins_install_dir) |
| 55 |
plugins += [gstsid] |