diff --git a/tests/meson.build b/tests/meson.build index 2dd870dd30..32d0b59a02 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,6 +1,11 @@ -gtest_proj = subproject('gtest') -gtest_dep = gtest_proj.get_variable('gtest_dep') -gmock_dep = gtest_proj.get_variable('gmock_dep') +gtest_dep = dependency('gtest', required : false) +gmock_dep = dependency('gmock', required : false) + +if not (gtest_dep.found() and gmock_dep.found()) + gtest_proj = subproject('gtest') + gtest_dep = gtest_proj.get_variable('gtest_dep') + gmock_dep = gtest_proj.get_variable('gmock_dep') +endif tests_deps = [ gtest_dep,