2019-10-12 13:19:49 +00:00
|
|
|
project(
|
|
|
|
'neatvnc',
|
|
|
|
'c',
|
|
|
|
version: '0.0.0',
|
|
|
|
license: 'ISC',
|
|
|
|
default_options: [
|
|
|
|
'c_std=gnu11',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-01-22 22:09:47 +00:00
|
|
|
buildtype = get_option('buildtype')
|
|
|
|
|
|
|
|
c_args = [
|
2019-10-12 13:19:49 +00:00
|
|
|
'-D_GNU_SOURCE',
|
|
|
|
'-fvisibility=hidden',
|
2020-01-22 22:09:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
if buildtype == 'release' or buildtype == 'plain'
|
|
|
|
c_args += '-DNDEBUG'
|
|
|
|
endif
|
2019-10-12 13:19:49 +00:00
|
|
|
|
2019-10-13 12:16:24 +00:00
|
|
|
cpu = host_machine.cpu_family()
|
|
|
|
|
|
|
|
if cpu == 'x86_64'
|
2020-01-22 22:09:47 +00:00
|
|
|
c_args += '-mavx'
|
2020-01-11 13:20:37 +00:00
|
|
|
elif cpu == 'arm'
|
2020-01-22 22:09:47 +00:00
|
|
|
c_args += '-mfpu=neon'
|
2019-10-13 12:16:24 +00:00
|
|
|
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')
|
|
|
|
libuv = dependency('libuv')
|
2019-12-31 10:13:21 +00:00
|
|
|
libturbojpeg = dependency('libturbojpeg', required: get_option('tight-encoding'))
|
2020-01-25 15:31:22 +00:00
|
|
|
gnutls = dependency('gnutls', required: get_option('tls'))
|
2019-10-12 13:19:49 +00:00
|
|
|
|
|
|
|
inc = include_directories('include', 'contrib/miniz')
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
'src/server.c',
|
|
|
|
'src/util.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',
|
2019-10-12 13:19:49 +00:00
|
|
|
'contrib/miniz/miniz.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
libm,
|
|
|
|
pixman,
|
|
|
|
libuv,
|
|
|
|
]
|
|
|
|
|
2019-12-31 10:13:21 +00:00
|
|
|
config = configuration_data()
|
|
|
|
|
|
|
|
if libturbojpeg.found()
|
|
|
|
dependencies += libturbojpeg
|
|
|
|
sources += 'src/tight.c'
|
|
|
|
config.set('ENABLE_TIGHT', true)
|
|
|
|
endif
|
|
|
|
|
2020-01-25 15:31:22 +00:00
|
|
|
if gnutls.found()
|
|
|
|
dependencies += gnutls
|
|
|
|
config.set('ENABLE_TLS', true)
|
|
|
|
endif
|
|
|
|
|
2019-12-31 10:13:21 +00:00
|
|
|
configure_file(
|
|
|
|
output: 'config.h',
|
|
|
|
configuration: config,
|
|
|
|
)
|
|
|
|
|
2019-10-12 15:23:46 +00:00
|
|
|
neatvnc = shared_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,
|
|
|
|
)
|
|
|
|
|
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'
|
|
|
|
)
|