forked from any1/wlvncc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
177 lines (151 loc) · 3.45 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
project(
'wlvncc',
'c',
version: '0.1.0',
license: 'ISC',
default_options: [
'c_std=gnu11',
],
)
cmake = import('cmake')
buildtype = get_option('buildtype')
host_system = host_machine.system()
prefix = get_option('prefix')
c_args = [
'-D_GNU_SOURCE',
'-DAML_UNSTABLE_API=1',
]
if buildtype != 'debug' and buildtype != 'debugoptimized'
c_args += '-DNDEBUG'
endif
add_project_arguments(c_args, language: 'c')
cc = meson.get_compiler('c')
libm = cc.find_library('m', required: false)
librt = cc.find_library('rt', required: false)
pthread = cc.find_library('pthread', required: false)
xkbcommon = dependency('xkbcommon')
pixman = dependency('pixman-1')
wayland_client = dependency('wayland-client')
wayland_cursor = dependency('wayland-cursor')
drm = dependency('libdrm')
gbm = dependency('gbm')
egl = dependency('egl')
glesv2 = dependency('glesv2')
lavc = dependency('libavcodec')
lavu = dependency('libavutil')
gcrypt = dependency('libgcrypt', required: false)
openssl = dependency('openssl', required: false)
gnutls = dependency('gnutls', required: false)
sasl = dependency('libsasl2', required: false)
libjpeg = dependency('libjpeg', required: false)
libpng = dependency('libpng', required: false)
lzo = dependency('lzo2', required: false)
libz = dependency('zlib', required: false)
aml_project = subproject('aml', required: false,
default_options: ['default_library=static'])
if aml_project.found()
aml = aml_project.get_variable('aml_dep')
else
aml = dependency('aml')
endif
inc = include_directories('include', 'src/encodings')
subdir('protocols')
sources = [
'src/main.c',
'src/shm.c',
'src/seat.c',
'src/output.c',
'src/pointer.c',
'src/keyboard.c',
'src/vnc.c',
'src/strlcpy.c',
'src/evdev-to-qnum.c',
'src/pixels.c',
'src/region.c',
'src/renderer.c',
'src/renderer-egl.c',
'src/buffer.c',
'src/open-h264.c',
'src/cursor.c',
'src/rfbproto.c',
'src/sockets.c',
'src/vncviewer.c',
]
dependencies = [
libm,
librt,
xkbcommon,
pixman,
aml,
wayland_client,
wayland_cursor,
drm,
gbm,
egl,
glesv2,
lavc,
lavu,
client_protos,
]
config = configuration_data()
config.set('PREFIX', '"' + prefix + '"')
if gcrypt.found()
sources += 'src/crypto_libgcrypt.c'
dependencies += gcrypt
elif openssl.found()
sources += 'src/crypto_openssl.c'
dependencies += openssl
else
sources += 'src/crypto_included.c'
endif
if gnutls.found()
sources += 'src/tls_gnutls.c'
dependencies += gnutls
config.set('LIBVNCSERVER_HAVE_GNUTLS', true)
elif openssl.found()
sources += 'src/tls_openssl.c'
dependencies += openssl
config.set('LIBVNCSERVER_HAVE_LIBSSL', true)
else
sources += 'src/tls_none.c'
endif
if sasl.found()
dependencies += sasl
sources += 'src/sasl.c'
config.set('LIBVNCSERVER_HAVE_SASL', true)
endif
if libjpeg.found()
sources += 'src/turbojpeg.c'
dependencies += libjpeg
config.set('LIBVNCSERVER_HAVE_LIBJPEG', true)
endif
if libpng.found()
dependencies += libpng
config.set('LIBVNCSERVER_HAVE_LIBPNG', true)
endif
if pthread.found()
dependencies += pthread
config.set('LIBVNCSERVER_HAVE_PTHREAD', true)
endif
if libz.found()
dependencies += libz
config.set('LIBVNCSERVER_HAVE_LIBZ', true)
endif
if lzo.found()
dependencies += lzo
config.set('LIBVNCSERVER_HAVE_LZO', true)
endif
if host_system == 'linux' and cc.has_header('sys/sdt.h')
config.set('HAVE_USDT', true)
endif
configure_file(
output: 'config.h',
configuration: config,
)
executable(
'wlvncc',
sources,
dependencies: dependencies,
include_directories: inc,
install: true,
)