diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-08 01:55:38 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-23 21:47:26 -0400 |
commit | 572baca1d4bad218805b71be7f92b2c0385ec1e6 (patch) | |
tree | 7c5ca93c75915bd34fdac920ab91c5d27d8bc49d | |
parent | 69e96427a2a77a4d1061ab9c54b9fd3dd1deafca (diff) | |
download | systemd-572baca1d4bad218805b71be7f92b2c0385ec1e6.tar.gz |
meson: add option to install tests
Instead of a separate target as with make, it is decided at configure time
whether to install tests as part of the install target. The effect should be
the same.
-rw-r--r-- | meson.build | 8 | ||||
-rw-r--r-- | meson_options.txt | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/meson.build b/meson.build index f7bcf48b9e..fc03f68d10 100644 --- a/meson.build +++ b/meson.build @@ -892,6 +892,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'], endforeach want_tests = get_option('tests') +install_tests = get_option('install-tests') tests = [] ##################################################################### @@ -1870,13 +1871,18 @@ foreach tuple : tests name = sources[0].split('/')[-1].split('.')[0] if condition == '' or conf.get(condition, 0) == 1 + install = install_tests and type == '' + exe = executable( name, sources, include_directories : incs, link_with : link_with, dependencies : dependencies, - c_args : defs) + c_args : defs, + install : install, + install_dir : testsdir) + if type == 'manual' message('@0@ is a manual test'.format(name)) elif type == 'unsafe' and want_tests != 'unsafe' diff --git a/meson_options.txt b/meson_options.txt index 9295b9c27c..981eace590 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -201,3 +201,5 @@ option('zshcompletiondir', type : 'string', option('tests', type : 'combo', choices : ['yes', 'unsafe'], description : 'enable extra tests with =unsafe') +option('install-tests', type : 'boolean', value : 'false', + description : 'install test executables') |