From 74d974817fafb4eea64b9115db624f931992dfe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 21 May 2017 09:37:14 +0100 Subject: [PATCH] meson: make C++ compiler optional It's only used to check our headers are C++ clean and for the Qt example. --- meson.build | 4 +++- tests/check/meson.build | 8 +++++++- tests/examples/overlay/meson.build | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index a8d4ee83dc..9092959c08 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('gst-plugins-base', 'c', 'cpp', +project('gst-plugins-base', 'c', version : '1.13.0.1', meson_version : '>= 0.36.0', default_options : [ 'warning_level=1', @@ -15,6 +15,8 @@ else gst_version_nano = 0 endif +have_cxx = add_languages('cpp', required : false) + glib_req = '>= 2.40.0' orc_req = '>= 0.4.24' gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) diff --git a/tests/check/meson.build b/tests/check/meson.build index e461a34570..e2f1e0f50a 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -64,9 +64,15 @@ base_tests = [ [ 'pipelines/theoraenc.c', not theoraenc_dep.found(), [ theoraenc_dep ] ], [ 'pipelines/vorbisenc.c', not vorbisenc_dep.found() ], [ 'pipelines/vorbisdec.c', not vorbisenc_dep.found(),], - [ 'libs/gstlibscpp.cc', false, [ ] ], ] +# Make sure our headers are C++ clean +if add_languages('cpp', required : false) + base_tests += [ + [ 'libs/gstlibscpp.cc', false, [ ] ], + ] +endif + # FIXME: enable orc testing #orc_tests = [ # 'orc/video', diff --git a/tests/examples/overlay/meson.build b/tests/examples/overlay/meson.build index c86046f9fe..2be262ebd3 100644 --- a/tests/examples/overlay/meson.build +++ b/tests/examples/overlay/meson.build @@ -7,7 +7,7 @@ if x11_dep.found() # FIXME: originally if USE_X install: false) endif - if add_languages('cpp') # check for C++ support + if have_cxx # check for C++ support qt5_mod = import('qt5') qt5widgets_dep = dependency('qt5', modules : ['Gui', 'Widgets'], required: false)