shithub: openh264

Download patch

ref: f5cc1c082fb481d491014b84194e07c5c612c1e5
parent: 1a287c681d4cd2f03dd0b969b75d1f6439cace13
author: Philippe Normand <philn@igalia.com>
date: Tue Aug 13 06:03:44 EDT 2019

meson: New build option to enable/disable tests

And bump Meson version required for 'feature' option types.

--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
 project('openh264', ['c', 'cpp'],
   version : '2.0.0',
-  meson_version : '>= 0.43',
+  meson_version : '>= 0.47',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
--- /dev/null
+++ b/meson_options.txt
@@ -1,0 +1,1 @@
+option('tests', type : 'feature', value : 'auto', yield : true)
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,15 +1,17 @@
-gtest_main_dep = dependency('gtest', main : true, fallback: ['gtest', 'gtest_main_dep'], required: false)
-gtest_dep = dependency('gtest', fallback: ['gtest', 'gtest_dep'], required: false)
+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)
 
-test_inc = include_directories('.')
+  test_inc = include_directories('.')
 
-test_data_generator_sources = files('api/DataGenerator.cpp')
-test_base_encoder_sources = files('api/BaseEncoderTest.cpp')
+  test_data_generator_sources = files('api/DataGenerator.cpp')
+  test_base_encoder_sources = files('api/BaseEncoderTest.cpp')
 
-if gtest_dep.found()
-  subdir('api')
-  subdir('common')
-  subdir('decoder')
-  subdir('encoder')
-  subdir('processing')
-endif
+  if gtest_dep.found()
+    subdir('api')
+    subdir('common')
+    subdir('decoder')
+    subdir('encoder')
+    subdir('processing')
+  endif
+endif
\ No newline at end of file