-
Notifications
You must be signed in to change notification settings - Fork 16
/
meson.build
80 lines (64 loc) · 2.04 KB
/
meson.build
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
project('openav_ctlra', 'c',
default_options : [
'c_std=gnu99',
'buildtype=release',
])
conf_data = configuration_data()
conf_data.set('version', '0.1')
cc = meson.get_compiler('c')
required_libs = ['libusb-1.0']
ctlra_lib_incs = []
if(get_option('avtka') == true)
avtka_dep = dependency('openav_avtka', required: false)
if (not avtka_dep.found())
avtka_git = subproject('avtka')
avtka_dep = avtka_git.get_variable('avtka_dep')
endif
add_project_arguments('-DHAVE_AVTKA', language : 'c')
required_libs += 'openav_avtka'
ctlra_lib_deps = avtka_dep
endif
if get_option('firmata')
firmatac = subproject('firmatac')
firmata_dep = firmatac.get_variable('firmatac_dep')
ctlra_lib_incs += include_directories('subprojects/firmatac/includes')
endif
if cc.has_header('libtcc.h')
conf_data.set('HAVE_TCC', 1)
else
conf_data.set('HAVE_TCC', 0)
endif
if get_option('midi')
midi_dep = dependency('alsa', required: false)
if midi_dep.found()
required_libs += ['alsa']
endif
else
warning('midi dep not found, disabling!!')
midi_dep = disabler()
endif
subdir('ctlra')
install_headers(ctlra_hdr, subdir : 'ctlra')
ctlra_includes = include_directories('ctlra')
if (get_option('examples') != '')
subdir('examples')
endif
# To copy files to the build directory
configure_file(input : 'examples/loopa/loopa_mk3.c',
output : 'loopa_mk3.c',
configuration : configuration_data())
# Copy UDEV rules to filesystem
udev_rules = '80-native-instruments.rules'
udev_paths = join_paths('resources', join_paths('udev_rules', udev_rules))
install_data(udev_paths, install_dir: '/etc/udev/rules.d')
# generate configuration file
configure_file(input : join_paths('ctlra', 'config.h.in'),
output : 'config.h',
configuration : conf_data)
pkg = import('pkgconfig')
pkg.generate(name: 'openav_ctlra',
description: 'OpenAV Ctlra Library',
version: conf_data.get('version'),
requires: required_libs,
subdirs : 'ctlra',
libraries: ctlra)