-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
65 lines (54 loc) · 1.06 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
project(
'npspi',
'c',
default_options: [
'c_std=c99',
],
)
api_version = '1.0'
abi_version = '1.0.0'
cc = meson.get_compiler('c')
libm = cc.find_library('m')
libev = cc.find_library('ev')
mpsse = cc.find_library('mpsse')
ftdi1 = dependency('libftdi1')
gdk_pixbuf = dependency('gdk-pixbuf-2.0')
deps = [
mpsse,
ftdi1,
]
lib_name = 'npspi-' + api_version
map_file = 'npspi.map'
link_args = '-Wl,--version-script,@0@/@1@'.format(
meson.current_source_dir(),
map_file
)
lib = library(
lib_name,
[
'npspi.c',
'nplut.c',
'npgammalut.c',
],
dependencies: deps,
install: true,
version: abi_version,
link_args: link_args,
link_depends: map_file,
)
install_headers('npspi.h', subdir: lib_name)
pkgconfig = import('pkgconfig')
pkgconfig.generate(
libraries: lib,
subdirs: [lib_name],
version: '1.0',
name: lib_name,
description: 'npspi',
)
executable(
'npspi-demo',
'main.c',
dependencies: [libm, libev, gdk_pixbuf],
link_with: [lib],
install: true,
)