shithub: openh264

Download patch

ref: 418b00eebef248000fc80f0f3e9988a9c042a784
parent: 19db13a5c5db7ebe98ddf63e00b13341757f59aa
parent: aa3a89918984780927d8fd1a3755bb228d1d73f4
author: guangwei <GuangweiWang@users.noreply.github.com>
date: Wed Jul 8 04:54:53 EDT 2020

Merge pull request #3256 from ystreet/automatic-gtest-dep

meson: disable tests automatically if gtest is not found

--- a/test/meson.build
+++ b/test/meson.build
@@ -1,13 +1,15 @@
-if not get_option('tests').disabled()
-  gtest_main_dep = dependency('gtest', main : true, fallback: ['gtest', 'gtest_main_dep'], required: true)
-  gtest_dep = dependency('gtest', fallback: ['gtest', 'gtest_dep'], required: true)
+build_tests = get_option('tests')
 
+if not build_tests.disabled()
+  gtest_main_dep = dependency('gtest', main : true, fallback: ['gtest', 'gtest_main_dep'], required: build_tests)
+  gtest_dep = dependency('gtest', fallback: ['gtest', 'gtest_dep'], required: build_tests)
+
   test_inc = include_directories('.')
 
   test_data_generator_sources = files('api/DataGenerator.cpp')
   test_base_encoder_sources = files('api/BaseEncoderTest.cpp')
 
-  if gtest_dep.found()
+  if gtest_dep.found() and gtest_main_dep.found()
     subdir('api')
     subdir('common')
     subdir('decoder')
@@ -14,4 +16,4 @@
     subdir('encoder')
     subdir('processing')
   endif
-endif
\ No newline at end of file
+endif