summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-12 21:47:56 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-09-13 12:07:34 +0200
commitfd1939fbe73c59aaa911363cfa4f7be748fb1d2a (patch)
tree030c923948059e399b8eb8af2139148c4cd64597 /meson.build
parent964bc0ad600f6d9fb90ed82f6a302988e843336d (diff)
downloadsystemd-fd1939fbe73c59aaa911363cfa4f7be748fb1d2a.tar.gz
meson: do not build tests by default when '-Dtests=false'
[zj: it is still possible to build tests explicitly by calling ninja -C build test-name. This way we have full flexibility.]
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build9
1 files changed, 6 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 12ddddd3eb..694c5cfcdd 100644
--- a/meson.build
+++ b/meson.build
@@ -1466,7 +1466,8 @@ test_dlopen = executable(
test_dlopen_c,
include_directories : includes,
link_with : [libbasic],
- dependencies : [libdl])
+ dependencies : [libdl],
+ build_by_default : want_tests != 'false')
foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
['systemd', 'ENABLE_NSS_SYSTEMD'],
@@ -2672,6 +2673,7 @@ exe = executable(
test_libsystemd_sym_c,
include_directories : includes,
link_with : [libsystemd],
+ build_by_default : want_tests != 'false',
install : install_tests,
install_dir : testsdir)
if want_tests != 'false'
@@ -2685,7 +2687,7 @@ exe = executable(
link_with : [install_libsystemd_static],
dependencies : [threads], # threads is already included in dependencies on the library,
# but does not seem to get propagated. Add here as a work-around.
- build_by_default : static_libsystemd_pic,
+ build_by_default : want_tests != 'false' and static_libsystemd_pic,
install : install_tests and static_libsystemd_pic,
install_dir : testsdir)
if want_tests != 'false' and static_libsystemd_pic
@@ -2698,6 +2700,7 @@ exe = executable(
include_directories : includes,
c_args : ['-Wno-deprecated-declarations'],
link_with : [libudev],
+ build_by_default : want_tests != 'false',
install : install_tests,
install_dir : testsdir)
if want_tests != 'false'
@@ -2710,7 +2713,7 @@ exe = executable(
include_directories : includes,
c_args : ['-Wno-deprecated-declarations'],
link_with : [install_libudev_static],
- build_by_default : static_libudev_pic,
+ build_by_default : want_tests != 'false' and static_libudev_pic,
install : install_tests and static_libudev_pic,
install_dir : testsdir)
if want_tests != 'false' and static_libudev_pic