Fix subproject gtest
Testing doesn't seem to be enabled if gtest isn't present. Resolve the
flows in meson.
Tested: without gtest installed, 'meson builddir' starts and runs unit
tests as expected.
Change-Id: Ie95bee7f429a4878083272a9886ea4c3d9977350
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/meson.build b/meson.build
index 7ba474c..58433bb 100644
--- a/meson.build
+++ b/meson.build
@@ -17,7 +17,6 @@
'-DBOOST_ALL_NO_LIB',
'-DBOOST_ALLOW_DEPRECATED_HEADERS',
]
-build_tests = get_option('tests')
cpp = meson.get_compiler('cpp')
boost = dependency('boost', required: false)
if not boost.found()
@@ -116,11 +115,11 @@
subdir('service_files')
subdir('src')
-if not build_tests.disabled()
+if get_option('tests').allowed()
test_boost_args = boost_args + ['-DBOOST_ASIO_DISABLE_THREADS']
gtest = dependency('gtest', main: true, disabler: true, required: false)
gmock = dependency('gmock', disabler: true, required: false)
- if not (gtest.found() and gmock.found()) and build_tests.enabled()
+ if not (gtest.found() and gmock.found())
cmake = import('cmake')
gtest_subproject = cmake.subproject('gtest')
cm_gtest = gtest_subproject.dependency('gtest')