wlvncc/meson.build

178 lines
3.4 KiB
Meson
Raw Normal View History

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',
]
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)
2022-05-31 21:18:34 +00:00
pthread = cc.find_library('pthread', required: false)
2020-07-10 14:26:27 +00:00
xkbcommon = dependency('xkbcommon')
pixman = dependency('pixman-1')
wayland_client = dependency('wayland-client')
2020-07-14 20:44:18 +00:00
wayland_cursor = dependency('wayland-cursor')
2022-04-09 12:00:11 +00:00
drm = dependency('libdrm')
gbm = dependency('gbm')
2022-04-09 15:21:24 +00:00
egl = dependency('egl')
glesv2 = dependency('glesv2')
2022-04-09 22:54:57 +00:00
lavc = dependency('libavcodec')
lavu = dependency('libavutil')
2022-05-31 21:18:34 +00:00
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
2022-05-31 21:18:34 +00:00
inc = include_directories('include', 'src/encodings')
subdir('protocols')
sources = [
'src/main.c',
2020-07-09 20:58:45 +00:00
'src/shm.c',
2020-07-10 10:45:10 +00:00
'src/seat.c',
2020-07-10 12:58:29 +00:00
'src/pointer.c',
2020-07-10 14:26:27 +00:00
'src/keyboard.c',
'src/vnc.c',
'src/vnc_encodings.c',
2020-07-10 10:45:10 +00:00
'src/strlcpy.c',
2020-11-30 21:59:55 +00:00
'src/evdev-to-qnum.c',
2022-03-30 21:48:21 +00:00
'src/pixels.c',
2022-04-02 12:51:37 +00:00
'src/region.c',
2022-04-03 22:17:27 +00:00
'src/renderer.c',
2022-04-09 15:21:24 +00:00
'src/renderer-egl.c',
2022-04-09 11:36:09 +00:00
'src/buffer.c',
2022-04-09 22:54:57 +00:00
'src/open-h264.c',
2022-05-31 21:18:34 +00:00
'src/cursor.c',
'src/listen.c',
'src/rfbproto.c',
'src/sockets.c',
'src/vncviewer.c',
'src/turbojpeg.c',
]
dependencies = [
libm,
librt,
2020-07-10 14:26:27 +00:00
xkbcommon,
pixman,
aml,
wayland_client,
2020-07-14 20:44:18 +00:00
wayland_cursor,
2022-04-09 12:00:11 +00:00
drm,
gbm,
2022-04-09 15:21:24 +00:00
egl,
glesv2,
2022-04-09 22:54:57 +00:00
lavc,
lavu,
client_protos,
]
config = configuration_data()
config.set('PREFIX', '"' + prefix + '"')
2022-05-31 21:18:34 +00:00
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()
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(
2020-07-11 21:35:13 +00:00
'wlvncc',
sources,
dependencies: dependencies,
include_directories: inc,
install: true,
)