diff options
author | Adam Duskett <Aduskett@gmail.com> | 2018-01-15 06:25:46 -0500 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-05-30 07:50:09 +0200 |
commit | 7ef95182343af165023847e42e27c17ff0047062 (patch) | |
tree | b8661d24c540cc1ec8b20d8af6ecb042b2806a63 /meson.build | |
parent | 89c7df51e966c0b0c080c5ecab238dbe289c7768 (diff) |
add false option for tests (#7778)
Currently there is no way to prevent tests from building using meson.
This introduces two problems:
1) It adds a extra 381 files to compile.
2) One of these tests explicitly requires libgcrypt to be built even if systemd
is not using it.
3) It adds C++ to the requirements to build systemd.
When cross-compiling, this is uneccessary.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/meson.build b/meson.build index bdda7561d..abc9fbecf 100644 --- a/meson.build +++ b/meson.build @@ -324,10 +324,12 @@ cc = meson.get_compiler('c') pkgconfig = import('pkgconfig') check_compilation_sh = find_program('tools/meson-check-compilation.sh') -cxx = find_program('c++', required : false) -if cxx.found() - # Used only for tests - add_languages('cpp') +if get_option('tests') != 'false' + cxx = find_program('c++', required : false) + if cxx.found() + # Used only for tests + add_languages('cpp') + endif endif foreach arg : ['-Wextra', @@ -2693,8 +2695,9 @@ foreach tuple : tests timeout = type.split('=')[1].to_int() type = '' endif - - if condition == '' or conf.get(condition) == 1 + if want_tests == 'false' + message('Not compiling @0@ because tests is set to false'.format(name)) + elif condition == '' or conf.get(condition) == 1 exe = executable( name, sources, |