aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: a575e224718262463fbfb92bb15e60facb7e191e (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
project('synthpod', ['c', 'cpp'], default_options : [
	'buildtype=release',
	'warning_level=1',
	'werror=false',
	'b_lto=false',
	'c_std=c11'])

cc = meson.get_compiler('c')

inc_incs = include_directories('include')
app_incs = include_directories('app')
xpress_incs = include_directories('xpress.lv2')
osc_incs = include_directories('osc.lv2')
extui_incs = include_directories('ext_ui.lv2')
ardour_incs = include_directories('ardour.lv2')
varchunk_incs = include_directories('varchunk')
crossclock_incs = include_directories('cross_clock')
lfrtm_incs = include_directories('lfrtm')
mapper_incs = include_directories('mapper.lv2')
sbox_incs = include_directories('sandbox_ui.lv2')
netatom_incs = include_directories('netatom.lv2')
props_incs = include_directories('props.lv2')
pugl_incs = include_directories('pugl')
self_incs = include_directories('')

bin_incs = [inc_incs, app_incs, xpress_incs, osc_incs, extui_incs, ardour_incs, varchunk_incs, crossclock_incs, lfrtm_incs, mapper_incs, sbox_incs, props_incs, pugl_incs, self_incs]

m_dep = cc.find_library('m')
rt_dep = cc.find_library('rt')
lv2_dep = dependency('lv2', version : '>=1.14.0')
thread_dep = dependency('threads')
lilv_dep = dependency('lilv-0', version : '>=0.24.0',
	static : meson.is_cross_build())
alsa_dep = dependency('alsa', version : '>=1.1.0', required : false)
zita_dep = cc.find_library('zita-alsa-pcmi', required : false)
jack_dep = dependency('jack', required : false)
gl_dep = dependency('gl', required : false)
x11_dep = dependency('x11', version : '>=1.6.0', required : false)
xext_dep = dependency('xext', version : '>=1.3.0', required : false)
xcb_dep = dependency('xcb', version : '>=1.12', required : false)
xcbicccm_dep = dependency('xcb-icccm', version : '>=0.4.0', required : false)
gtk2_dep = dependency('gtk+-2.0', version : '>=2.24', required : false)
gtk3_dep = dependency('gtk+-3.0', version : '>=3.22', required : false)
qt4_dep = dependency('qt4', modules : ['Core', 'Gui'], required : false)
qt5_dep = dependency('qt5', modules : ['Core', 'Widgets', 'Gui'], required : false)

bin_deps = [m_dep, rt_dep, lv2_dep, thread_dep, lilv_dep]

rawvers = run_command('cat', 'VERSION').stdout().strip()
version = rawvers.split('.')

conf_data = configuration_data()
conf_data.set('MAJOR_VERSION', version[0])
conf_data.set('MINOR_VERSION', version[1])
conf_data.set('MICRO_VERSION', version[2])

prefix = get_option('prefix')
bndl_dir = join_paths(get_option('libdir'), meson.project_name(), 'lv2')
plug_dir = join_paths(get_option('libdir'), 'lv2', meson.project_name()+'.lv2')

if get_option('dynamic-parallelizer')
	message('using dynamic parallelizer')
	add_project_arguments('-DUSE_DYNAMIC_PARALLELIZER', language : 'c')
endif

if gl_dep.found()
	add_project_arguments('-DPUGL_HAVE_GL', language : 'c')
endif

if xcb_dep.found() and xcbicccm_dep.found()
	message('building X11 sandbox')
	add_project_arguments('-DSANDBOX_X11', language : 'c')
endif

if gtk2_dep.found()
	message('building GTK2 sandbox')
	add_project_arguments('-DSANDBOX_GTK2', language : 'c')
endif

if gtk3_dep.found()
	message('building GTK3 sandbox')
	add_project_arguments('-DSANDBOX_GTK3', language : 'c')
endif

if qt4_dep.found()
	message('building QT4 sandbox')
	add_project_arguments('-DSANDBOX_QT4', language : 'c')
endif

if qt5_dep.found()
	message('building QT5 sandbox')
	add_project_arguments('-DSANDBOX_QT5', language : 'c')
endif

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

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

if lilv_dep.version() >= '0.22.0'
	message('building against recent lilv')
	add_project_arguments('-DLILV_0_22', language : 'c')
endif

add_project_arguments('-D_GNU_SOURCE', language : 'c')
add_project_arguments('-DHAS_BUILTIN_ASSUME_ALIGNED', language : 'c')
add_project_arguments('-DSYNTHPOD_VERSION="'+rawvers+'"', language : 'c')
add_project_arguments('-DSYNTHPOD_MINOR_VERSION='+version[1]+'', language : 'c')
add_project_arguments('-DSYNTHPOD_MICRO_VERSION='+version[2]+'', language : 'c')
add_project_arguments('-DSYNTHPOD_BUNDLE_DIR="'+join_paths(prefix, bndl_dir, '')+'"', language : 'c')
add_project_arguments('-DSYNTHPOD_BIN_DIR="'+join_paths(prefix, get_option('bindir'), '')+'"', language : 'c')
add_project_arguments('-DSYNTHPOD_PLUGIN_DIR="'+join_paths(prefix, plug_dir, '')+'"', language : 'c')

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

c_args = ['-fvisibility=hidden',
	'-ffast-math',
	'-Wno-attributes',
	'-Wno-unused-function',
	'-Wno-unused-variable']

subdir('sandbox_ui.lv2')
subdir('app')
subdir('plugins')
subdir('bin')
subdir('bundle')