From ad0ff6b27c2cec987c94d9ae870604bc36fb7b10 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Tue, 31 Dec 2019 10:13:21 +0000 Subject: [PATCH] Make Tight encoding optional --- meson.build | 17 ++++++++++++++--- meson_options.txt | 1 + src/server.c | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index 6941cd2..39a4f2b 100644 --- a/meson.build +++ b/meson.build @@ -35,7 +35,7 @@ libm = cc.find_library('m', required: false) pixman = dependency('pixman-1') libuv = dependency('libuv') -libturbojpeg = dependency('libturbojpeg') +libturbojpeg = dependency('libturbojpeg', required: get_option('tight-encoding')) inc = include_directories('include', 'contrib/miniz') @@ -44,7 +44,6 @@ sources = [ 'src/util.c', 'src/vec.c', 'src/zrle.c', - 'src/tight.c', 'src/raw-encoding.c', 'src/pixels.c', 'src/damage.c', @@ -56,9 +55,21 @@ dependencies = [ libm, pixman, libuv, - libturbojpeg, ] +config = configuration_data() + +if libturbojpeg.found() + dependencies += libturbojpeg + sources += 'src/tight.c' + config.set('ENABLE_TIGHT', true) +endif + +configure_file( + output: 'config.h', + configuration: config, +) + neatvnc = shared_library( 'neatvnc', sources, diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..96abdf1 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('tight-encoding', type: 'feature', value: 'disabled', description: 'Enable Tight encoding (experimental)') diff --git a/src/server.c b/src/server.c index e7a5199..d3bdcc5 100644 --- a/src/server.c +++ b/src/server.c @@ -25,6 +25,7 @@ #include "neatvnc.h" #include "common.h" #include "pixels.h" +#include "config.h" #include #include