aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: c660f5027d9bdcc6e04e5e769555a35852dbc80f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
project('chim.lv2', 'c', default_options : [
	'buildtype=release',
	'warning_level=1',
	'werror=false',
	'b_lto=true',
	'c_std=c11'])

add_project_arguments('-D_GNU_SOURCE', language : 'c')

conf_data = configuration_data()
cc = meson.get_compiler('c')

cp = find_program('cp')
clone = [cp, '@INPUT@', '@OUTPUT@']

m_dep = cc.find_library('m')
lv2_dep = dependency('lv2', version : '>=1.14.0')
dsp_deps = [m_dep, lv2_dep]

props_inc = include_directories('props.lv2')
osc_inc = include_directories('osc.lv2')
canvas_inc = include_directories('canvas.lv2')
inc_dir = [props_inc, osc_inc, canvas_inc]

inst_dir = join_paths(get_option('libdir'), 'lv2', meson.project_name())

dsp_srcs = ['chim.c',
	'chim_dump.c']

c_args = ['-fvisibility=hidden',
	'-ffast-math']

if host_machine.system() == 'linux'
	# nothing
elif host_machine.system() == 'windows'
	dsp_deps += cc.find_library('ws2_32')
elif host_machine.system() == 'darwin'
	# nothing
endif

mod = shared_module('chim', dsp_srcs,
	c_args : c_args,
	include_directories : inc_dir,
	name_prefix : '',
	dependencies : dsp_deps,
	install : true,
	install_dir : inst_dir)

version = run_command('cat', 'VERSION').stdout().strip().split('.')
conf_data.set('MAJOR_VERSION', version[0])
conf_data.set('MINOR_VERSION', version[1])
conf_data.set('MICRO_VERSION', version[2])

suffix = mod.full_path().strip().split('.')[-1]
conf_data.set('MODULE_SUFFIX', '.' + suffix)

configure_file(input : 'manifest.ttl.in', output : 'manifest.ttl',
	configuration : conf_data,
	install : true,
	install_dir : inst_dir)
custom_target('chim_ttl',
	input : 'chim.ttl',
	output : 'chim.ttl',
	command : clone,
	install : true,
	install_dir : inst_dir)