From 6d34f57cb64a8b4ea55aba84a54d9fd21d00dfda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 10 Aug 2018 01:23:35 +0100 Subject: [PATCH] meson: add option to disable build of GStreamer unit test library --- libs/gst/meson.build | 7 ++++++- meson_options.txt | 1 + pkgconfig/meson.build | 9 ++++++--- tests/check/meson.build | 7 +++++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/libs/gst/meson.build b/libs/gst/meson.build index 38dcec9354..0313c0a81a 100644 --- a/libs/gst/meson.build +++ b/libs/gst/meson.build @@ -2,4 +2,9 @@ subdir('base') subdir('controller') subdir('net') subdir('helpers') -subdir('check') + +if get_option('check').disabled() + gst_check_dep = disabler() # KISS for now +else + subdir('check') +endif diff --git a/meson_options.txt b/meson_options.txt index fbb0a9cd58..d5c3873e97 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -18,6 +18,7 @@ option('memory-alignment', type: 'combo', value: 'malloc') # Feature options +option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries') option('libunwind', type : 'feature', value : 'auto', description : 'Use libunwind to generate backtraces') option('bash-completion', type : 'feature', value : 'auto', description : 'Install bash completion files') diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build index edb0586c2d..9843772897 100644 --- a/pkgconfig/meson.build +++ b/pkgconfig/meson.build @@ -22,14 +22,17 @@ pkgconf.set('netlibdir', join_paths(meson.build_root(), gst_net.outdir())) pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir')) -pkg_files = ['gstreamer-base', +pkg_files = [ + 'gstreamer-base', 'gstreamer-controller', - 'gstreamer-check', 'gstreamer-net', 'gstreamer' ] -pkgconf.set('checklibdir', join_paths(meson.build_root(), gst_check.outdir())) +if not get_option('check').disabled() + pkg_files += ['gstreamer-check'] + pkgconf.set('checklibdir', join_paths(meson.build_root(), gst_check.outdir())) +endif foreach p : pkg_files infile = p + '.pc.in' diff --git a/tests/check/meson.build b/tests/check/meson.build index 0e7edd18f9..c6111c76d5 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -126,6 +126,13 @@ test_defines = [ '-DGST_DISABLE_DEPRECATED', ] +# sanity checking +if get_option('check').disabled() + if get_option('tests').enabled() + error('Building of unit tests was requested, but GStreamer check library was disabled.') + endif +endif + glib_deps = [gio_dep, gobject_dep, gmodule_dep, glib_dep] gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep]