aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: cc707cb6c6d84674d8c5a1af7dca416506a9d859 (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
project('lv2lint', 'c', default_options : [
	'buildtype=release',
	'warning_level=1',
	'b_lto=true',
	'c_std=c11'])

online_tests = get_option('online-tests')
elf_tests = get_option('elf-tests')

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

add_project_arguments('-DLV2LINT_VERSION="'+version+'"', language : 'c')
add_project_arguments('-D_GNU_SOURCE', language : 'c')

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

m_dep = cc.find_library('m')
lv2_dep = dependency('lv2', version : '>=1.14.0')
lilv_dep = dependency('lilv-0', version : '>=0.24.0')
curl_dep = dependency('libcurl', required: false)
elf_dep = dependency('libelf', required: false)

if curl_dep.found() and online_tests
	add_project_arguments('-DENABLE_ONLINE_TESTS', language : 'c')
	conf_data.set('MAN', '')
else
	conf_data.set('MAN', './')
endif

if elf_dep.found() and elf_tests
	add_project_arguments('-DENABLE_ELF_TESTS', language : 'c')
endif

executable('lv2lint',
	'lv2lint.c',
	'lv2lint_plugin.c',
	'lv2lint_port.c',
	'lv2lint_parameter.c',
	'lv2lint_ui.c',
	dependencies : [m_dep, lv2_dep, lilv_dep, curl_dep, elf_dep],
	install : true)

configure_file(input : 'lv2lint.1.in', output : 'lv2lint.1',
	configuration : conf_data)

install_man(meson.current_build_dir()+'/lv2lint.1')