meson.build: enable CPP include check only in case CPP compiler is available

Drop hard meson C++/CPP dependency, only needed for the build-time
header inclusion test, build the test only in case C++/CPP compiler
is available.

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Seiderer 2019-01-12 11:10:46 +01:00 committed by Peter Hutterer
parent fc029e3fb5
commit 4516ba977c

View file

@ -1,4 +1,4 @@
project('libinput', 'c', 'cpp',
project('libinput', 'c',
version : '1.12.3',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
@ -651,12 +651,14 @@ executable('test-build-linker',
include_directories : [includes_src, includes_include],
dependencies : [ dep_libinput, dep_libinput_util ],
install : false)
# test including from C++
executable('test-build-cxx',
'test/build-cxx.cc',
dependencies : [dep_udev],
include_directories : [includes_src, includes_include],
install : false)
# test including from C++ (in case CPP compiler is available)
if add_languages('cpp', required: false)
executable('test-build-cxx',
'test/build-cxx.cc',
dependencies : [dep_udev],
include_directories : [includes_src, includes_include],
install : false)
endif
# This is the test suite runner, we allow disabling that one because of
# dependencies