-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
meson.build
107 lines (86 loc) · 1.8 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
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
project(
'neatvnc',
'c',
version: '0.1.0',
license: 'ISC',
default_options: [
'c_std=gnu11',
],
)
buildtype = get_option('buildtype')
c_args = [
'-D_GNU_SOURCE',
'-fvisibility=hidden',
]
if buildtype == 'release' or buildtype == 'plain'
c_args += '-DNDEBUG'
endif
cpu = host_machine.cpu_family()
if cpu == 'x86_64'
c_args += '-mavx'
elif cpu == 'arm'
c_args += '-mfpu=neon'
endif
add_project_arguments(c_args, language: 'c')
cc = meson.get_compiler('c')
libm = cc.find_library('m', required: false)
pixman = dependency('pixman-1')
libuv = dependency('libuv')
libturbojpeg = dependency('libturbojpeg', required: get_option('tight-encoding'))
gnutls = dependency('gnutls', required: get_option('tls'))
inc = include_directories('include', 'contrib/miniz')
sources = [
'src/server.c',
'src/vec.c',
'src/zrle.c',
'src/raw-encoding.c',
'src/pixels.c',
'src/damage.c',
'src/fb.c',
'src/rcbuf.c',
'src/stream.c',
'contrib/miniz/miniz.c',
]
dependencies = [
libm,
pixman,
libuv,
]
config = configuration_data()
if libturbojpeg.found()
dependencies += libturbojpeg
sources += 'src/tight.c'
config.set('ENABLE_TIGHT', true)
endif
if gnutls.found()
dependencies += gnutls
config.set('ENABLE_TLS', true)
endif
configure_file(
output: 'config.h',
configuration: config,
)
neatvnc = shared_library(
'neatvnc',
sources,
version: '0.0.0',
dependencies: dependencies,
include_directories: inc,
install: true,
)
neatvnc_dep = declare_dependency(
include_directories: inc,
link_with: neatvnc,
)
if get_option('examples')
subdir('examples')
endif
install_headers('include/neatvnc.h')
pkgconfig = import('pkgconfig')
pkgconfig.generate(
libraries: neatvnc,
version: meson.project_version(),
filebase: meson.project_name(),
name: meson.project_name(),
description: 'A Neat VNC server library'
)