meson: Enable tests by default
The test subdirectory should no longer be compiled when `tests`
disabled, So tests should be explicitly enabled by default.
Also `tests` has been disabled in meta-phosphor[1].
[1] https://gerrit.openbmc.org/c/openbmc/openbmc/+/43812
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I80352925719d3be137f99457ff38a948413f9c17
diff --git a/meson.build b/meson.build
index 4e1cc60..a75d25e 100644
--- a/meson.build
+++ b/meson.build
@@ -14,8 +14,6 @@
cxx = meson.get_compiler('cpp')
-build_tests = get_option('tests')
-
libevdev = dependency('libevdev')
libsystemd = dependency('libsystemd')
libgpiod = dependency('libgpiod')
@@ -145,4 +143,8 @@
)
subdir('presence')
-subdir('test')
+
+build_tests = get_option('tests')
+if build_tests.allowed()
+ subdir('test')
+endif