2020-07-09 19:12:31 +00:00
|
|
|
project(
|
|
|
|
'wlvncc',
|
|
|
|
'c',
|
|
|
|
version: '0.1.0',
|
|
|
|
license: 'ISC',
|
|
|
|
default_options: [
|
|
|
|
'c_std=gnu11',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-11-30 21:19:10 +00:00
|
|
|
cmake = import('cmake')
|
|
|
|
|
2020-07-09 19:12:31 +00:00
|
|
|
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)
|
|
|
|
|
2020-07-10 14:26:27 +00:00
|
|
|
xkbcommon = dependency('xkbcommon')
|
2020-07-11 17:54:35 +00:00
|
|
|
pixman = dependency('pixman-1')
|
2020-07-09 19:12:31 +00:00
|
|
|
wayland_client = dependency('wayland-client')
|
2020-07-14 20:44:18 +00:00
|
|
|
wayland_cursor = dependency('wayland-cursor')
|
2020-11-30 21:19:10 +00:00
|
|
|
|
2020-12-06 14:57:09 +00:00
|
|
|
libvncserver_opt = cmake.subproject_options()
|
2020-12-06 15:32:08 +00:00
|
|
|
libvncserver_opt.add_cmake_defines({
|
|
|
|
'BUILD_SHARED_LIBS': false,
|
|
|
|
'LIBVNCSERVER_INSTALL': false,
|
|
|
|
})
|
2020-12-06 14:57:09 +00:00
|
|
|
|
2020-12-06 22:16:58 +00:00
|
|
|
libvncserver_project = cmake.subproject('libvncserver', required: false,
|
|
|
|
options: libvncserver_opt)
|
2020-11-30 21:19:10 +00:00
|
|
|
if libvncserver_project.found()
|
|
|
|
libvncclient = libvncserver_project.dependency('vncclient')
|
|
|
|
else
|
|
|
|
libvncclient = dependency('libvncclient')
|
|
|
|
endif
|
2020-07-09 19:12:31 +00:00
|
|
|
|
2020-12-06 15:03:57 +00:00
|
|
|
aml_project = subproject('aml', required: false,
|
|
|
|
default_options: ['default_library=static'])
|
2020-07-09 19:12:31 +00:00
|
|
|
if aml_project.found()
|
|
|
|
aml = aml_project.get_variable('aml_dep')
|
|
|
|
else
|
|
|
|
aml = dependency('aml')
|
|
|
|
endif
|
|
|
|
|
|
|
|
inc = include_directories('include')
|
|
|
|
|
|
|
|
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',
|
2020-07-11 17:54:35 +00:00
|
|
|
'src/vnc.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',
|
2021-06-08 13:12:58 +00:00
|
|
|
'src/inhibitor.c',
|
2020-07-09 19:12:31 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
libm,
|
|
|
|
librt,
|
2020-07-10 14:26:27 +00:00
|
|
|
xkbcommon,
|
2020-07-11 17:54:35 +00:00
|
|
|
pixman,
|
2020-07-09 19:12:31 +00:00
|
|
|
aml,
|
|
|
|
wayland_client,
|
2020-07-14 20:44:18 +00:00
|
|
|
wayland_cursor,
|
2020-07-10 00:14:29 +00:00
|
|
|
libvncclient,
|
2020-07-09 19:12:31 +00:00
|
|
|
client_protos,
|
|
|
|
]
|
|
|
|
|
|
|
|
config = configuration_data()
|
|
|
|
|
|
|
|
config.set('PREFIX', '"' + prefix + '"')
|
|
|
|
|
|
|
|
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',
|
2020-07-09 19:12:31 +00:00
|
|
|
sources,
|
|
|
|
dependencies: dependencies,
|
|
|
|
include_directories: inc,
|
|
|
|
install: true,
|
|
|
|
)
|