LV2 subproject with meson
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.6 KiB

project('lv2', ['c'],
version: '1.18.3',
license: 'ISC',
meson_version: '>= 0.49.2',
default_options: [
'b_ndebug=if-release',
'buildtype=release',
'c_std=c99',
'default_library=both',
'warning_level=2',
])
# Load build tools
pkg = import('pkgconfig')
cc = meson.get_compiler('c')
# Set ultra strict warnings for developers, if requested
if get_option('strict')
subdir('meson')
c_warnings = all_c_warnings
if cc.get_id() == 'clang'
c_warnings += [
'-Wno-cast-align',
'-Wno-cast-qual',
'-Wno-documentation-unknown-command',
'-Wno-double-promotion',
'-Wno-float-conversion',
'-Wno-float-equal',
'-Wno-implicit-float-conversion',
'-Wno-padded',
'-Wno-reserved-id-macro',
'-Wno-shorten-64-to-32',
'-Wno-sign-conversion',
'-Wno-switch-enum',
'-Wno-unused-parameter',
]
elif cc.get_id() == 'gcc'
c_warnings += [
'-Wno-cast-align',
'-Wno-cast-qual',
'-Wno-conversion',
'-Wno-double-promotion',
'-Wno-float-equal',
'-Wno-inline',
'-Wno-padded',
'-Wno-parentheses',
'-Wno-suggest-attribute=const',
'-Wno-suggest-attribute=malloc',
'-Wno-suggest-attribute=pure',
'-Wno-switch-enum',
'-Wno-unused-parameter',
]
elif cc.get_id() == 'msvc'
c_warnings += [
'/wd4061', # enumerator in switch is not explicitly handled
'/wd4100', # unreferenced formal parameter
'/wd4244', # conversion with possible loss of data
'/wd4267', # conversion from size_t to a smaller type
'/wd4310', # cast truncates constant value
'/wd4365', # signed/unsigned mismatch
'/wd4464', # relative include path contains ".."
'/wd4514', # unreferenced inline function has been removed
'/wd4706', # assignment within conditional expression
'/wd4710', # function not inlined
'/wd4711', # function selected for automatic inline expansion
'/wd4820', # padding added after construct
'/wd5045', # will insert Spectre mitigation for memory load
]
endif
add_project_arguments(cc.get_supported_arguments(c_warnings),
language: ['c'])
endif
if host_machine.system() == 'darwin'
lv2dir = '/Library/Audio/Plug-Ins/LV2'
default_lv2_path = [
'~/Library/Audio/Plug-Ins/LV2',
'~/.lv2',
'/usr/local/lib/lv2',
'/usr/lib/lv2',
'/Library/Audio/Plug-Ins/LV2',
]
elif host_machine.system() == 'haiku'
default_lv2_path = [
'~/.lv2',
'/boot/common/add-ons/lv2',
]
elif host_machine.system() == 'win32'
lv2dir = env_path('COMMONPROGRAMFILES', 'LV2')
default_lv2_path = [
'%APPDATA%\\\\LV2',
'%COMMONPROGRAMFILES%\\\\LV2',
]
else
libdirname = get_option('libdir')
lv2dir = get_option('prefix') / get_option('libdir')
default_lv2_path = [
'~/.lv2',
'/usr/@0@/lv2'.format(libdirname),
'/usr/local/@0@/lv2'.format(libdirname),
]
endif
# Map of specification base name to old URI-style include path
spec_map = {
'atom': 'lv2/lv2plug.in/ns/ext/atom',
'buf-size': 'lv2/lv2plug.in/ns/ext/buf-size',
'core': 'lv2/lv2plug.in/ns/lv2core',
'data-access': 'lv2/lv2plug.in/ns/ext/data-access',
'dynmanifest': 'lv2/lv2plug.in/ns/ext/dynmanifest',
'event': 'lv2/lv2plug.in/ns/ext/event',
'instance-access': 'lv2/lv2plug.in/ns/ext/instance-access',
'log': 'lv2/lv2plug.in/ns/ext/log',
'midi': 'lv2/lv2plug.in/ns/ext/midi',
'morph': 'lv2/lv2plug.in/ns/ext/morph',
'options': 'lv2/lv2plug.in/ns/ext/options',
'parameters': 'lv2/lv2plug.in/ns/ext/parameters',
'patch': 'lv2/lv2plug.in/ns/ext/patch',
'port-groups': 'lv2/lv2plug.in/ns/ext/port-groups',
'port-props': 'lv2/lv2plug.in/ns/ext/port-props',
'presets': 'lv2/lv2plug.in/ns/ext/presets',
'resize-port': 'lv2/lv2plug.in/ns/ext/resize-port',
'state': 'lv2/lv2plug.in/ns/ext/state',
'time': 'lv2/lv2plug.in/ns/ext/time',
'ui': 'lv2/lv2plug.in/ns/extensions/ui',
'units': 'lv2/lv2plug.in/ns/extensions/units',
'uri-map': 'lv2/lv2plug.in/ns/ext/uri-map',
'urid': 'lv2/lv2plug.in/ns/ext/urid',
'worker': 'lv2/lv2plug.in/ns/ext/worker',
}
lv2_dep = declare_dependency(
include_directories: include_directories('.'),
version: meson.project_version())
# plugins/eg-fifths.lv2/uris.h
# plugins/eg-params.lv2/state_map.h
# plugins/eg-sampler.lv2/atom_sink.h
# plugins/eg-sampler.lv2/peaks.h
# plugins/eg-sampler.lv2/uris.h
# plugins/eg-scope.lv2/uris.h