2019-10-12 13:19:49 +00:00
|
|
|
project(
|
|
|
|
'neatvnc',
|
|
|
|
'c',
|
2020-07-26 11:43:00 +00:00
|
|
|
version: '0.2.0',
|
2019-10-12 13:19:49 +00:00
|
|
|
license: 'ISC',
|
|
|
|
default_options: [
|
|
|
|
'c_std=gnu11',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-01-22 22:09:47 +00:00
|
|
|
buildtype = get_option('buildtype')
|
2020-04-01 22:49:58 +00:00
|
|
|
host_system = host_machine.system()
|
2020-01-22 22:09:47 +00:00
|
|
|
|
|
|
|
c_args = [
|
2020-07-26 11:43:00 +00:00
|
|
|
'-DPROJECT_VERSION="@0@"'.format(meson.project_version()),
|
2019-10-12 13:19:49 +00:00
|
|
|
'-D_GNU_SOURCE',
|
|
|
|
'-fvisibility=hidden',
|
2020-05-20 22:43:12 +00:00
|
|
|
'-Wmissing-prototypes',
|
2020-01-22 22:09:47 +00:00
|
|
|
]
|
|
|
|
|
2020-04-12 14:25:49 +00:00
|
|
|
if buildtype != 'debug' and buildtype != 'debugoptimized'
|
2020-01-22 22:09:47 +00:00
|
|
|
c_args += '-DNDEBUG'
|
|
|
|
endif
|
2019-10-12 13:19:49 +00:00
|
|
|
|
2020-07-26 11:43:00 +00:00
|
|
|
git = find_program('git', native: true, required: false)
|
|
|
|
if git.found()
|
|
|
|
git_describe = run_command([git, 'describe', '--tags', '--long'])
|
|
|
|
git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'])
|
|
|
|
if git_describe.returncode() == 0 and git_branch.returncode() == 0
|
|
|
|
c_args += '-DGIT_VERSION="@0@ (@1@)"'.format(
|
|
|
|
git_describe.stdout().strip(),
|
|
|
|
git_branch.stdout().strip(),
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-01-22 22:09:47 +00:00
|
|
|
add_project_arguments(c_args, language: 'c')
|
2019-10-13 12:16:24 +00:00
|
|
|
|
2019-10-12 13:19:49 +00:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
|
|
libm = cc.find_library('m', required: false)
|
|
|
|
|
|
|
|
pixman = dependency('pixman-1')
|
2020-07-11 20:16:27 +00:00
|
|
|
libturbojpeg = dependency('libturbojpeg', required: get_option('jpeg'))
|
2020-01-25 15:31:22 +00:00
|
|
|
gnutls = dependency('gnutls', required: get_option('tls'))
|
2020-04-03 22:31:16 +00:00
|
|
|
zlib = dependency('zlib')
|
2019-10-12 13:19:49 +00:00
|
|
|
|
2020-03-16 20:09:22 +00:00
|
|
|
aml_project = subproject('aml', required: false)
|
|
|
|
if aml_project.found()
|
|
|
|
aml = aml_project.get_variable('aml_dep')
|
|
|
|
else
|
|
|
|
aml = dependency('aml')
|
|
|
|
endif
|
|
|
|
|
2020-04-03 22:31:16 +00:00
|
|
|
inc = include_directories('include')
|
2019-10-12 13:19:49 +00:00
|
|
|
|
|
|
|
sources = [
|
|
|
|
'src/server.c',
|
|
|
|
'src/vec.c',
|
|
|
|
'src/zrle.c',
|
|
|
|
'src/raw-encoding.c',
|
|
|
|
'src/pixels.c',
|
|
|
|
'src/damage.c',
|
|
|
|
'src/fb.c',
|
2020-01-25 15:29:25 +00:00
|
|
|
'src/rcbuf.c',
|
2020-01-25 15:31:22 +00:00
|
|
|
'src/stream.c',
|
2020-04-12 18:16:19 +00:00
|
|
|
'src/display.c',
|
2020-07-11 20:16:27 +00:00
|
|
|
'src/tight.c',
|
2020-09-26 16:10:25 +00:00
|
|
|
'src/enc-util.c',
|
2019-10-12 13:19:49 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
libm,
|
|
|
|
pixman,
|
2020-03-16 20:09:22 +00:00
|
|
|
aml,
|
2020-04-03 22:31:16 +00:00
|
|
|
zlib,
|
2019-10-12 13:19:49 +00:00
|
|
|
]
|
|
|
|
|
2019-12-31 10:13:21 +00:00
|
|
|
config = configuration_data()
|
|
|
|
|
|
|
|
if libturbojpeg.found()
|
|
|
|
dependencies += libturbojpeg
|
2020-07-11 20:16:27 +00:00
|
|
|
config.set('HAVE_JPEG', true)
|
2019-12-31 10:13:21 +00:00
|
|
|
endif
|
|
|
|
|
2020-01-25 15:31:22 +00:00
|
|
|
if gnutls.found()
|
|
|
|
dependencies += gnutls
|
|
|
|
config.set('ENABLE_TLS', true)
|
|
|
|
endif
|
|
|
|
|
2020-04-01 22:49:58 +00:00
|
|
|
if host_system == 'linux' and cc.has_header('sys/sdt.h')
|
|
|
|
config.set('HAVE_USDT', true)
|
|
|
|
endif
|
|
|
|
|
2019-12-31 10:13:21 +00:00
|
|
|
configure_file(
|
|
|
|
output: 'config.h',
|
|
|
|
configuration: config,
|
|
|
|
)
|
|
|
|
|
2020-07-22 04:37:35 +00:00
|
|
|
neatvnc = library(
|
2019-10-12 13:19:49 +00:00
|
|
|
'neatvnc',
|
|
|
|
sources,
|
2019-10-12 14:47:07 +00:00
|
|
|
version: '0.0.0',
|
2019-10-12 13:19:49 +00:00
|
|
|
dependencies: dependencies,
|
|
|
|
include_directories: inc,
|
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
|
2019-10-12 15:23:46 +00:00
|
|
|
neatvnc_dep = declare_dependency(
|
|
|
|
include_directories: inc,
|
|
|
|
link_with: neatvnc,
|
|
|
|
)
|
|
|
|
|
2020-02-09 11:41:43 +00:00
|
|
|
if get_option('examples')
|
|
|
|
subdir('examples')
|
|
|
|
endif
|
|
|
|
|
2020-05-27 21:59:34 +00:00
|
|
|
if get_option('benchmarks')
|
|
|
|
subdir('bench')
|
|
|
|
endif
|
|
|
|
|
2019-10-12 13:19:49 +00:00
|
|
|
install_headers('include/neatvnc.h')
|
2019-10-12 14:47:07 +00:00
|
|
|
|
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
pkgconfig.generate(
|
2019-10-12 15:23:46 +00:00
|
|
|
libraries: neatvnc,
|
2019-10-12 14:47:07 +00:00
|
|
|
version: meson.project_version(),
|
|
|
|
filebase: meson.project_name(),
|
|
|
|
name: meson.project_name(),
|
|
|
|
description: 'A Neat VNC server library'
|
|
|
|
)
|