From 1265f5c239da2963e49e9b4b1a5c32cd506f8ea4 Mon Sep 17 00:00:00 2001 From: Piotr Rak Date: Thu, 24 Sep 2020 21:49:43 +0200 Subject: [PATCH 1/3] Bump required meson version to 0.54.0 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ae6e1ec9..7565c9e1 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'avcpp', 'cpp', - meson_version: '>= 0.50.0', + meson_version: '>= 0.54.0', default_options : [ 'c_std=c11', 'cpp_std=c++17' From f14f718259300261e4e6edb39e501f064e37fe9f Mon Sep 17 00:00:00 2001 From: Piotr Rak Date: Thu, 24 Sep 2020 00:24:43 +0200 Subject: [PATCH 2/3] Honour option settings when built as subproject. Some user may want to use test suite in their builds. --- example/api2-samples/meson.build | 4 ++++ meson.build | 28 ++++++++++++---------------- tests/meson.build | 5 +++++ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/example/api2-samples/meson.build b/example/api2-samples/meson.build index ab218720..c965c29d 100644 --- a/example/api2-samples/meson.build +++ b/example/api2-samples/meson.build @@ -7,6 +7,10 @@ #libavcpp = subproject('avcpp') #avcpp_dep = libavcpp.get_variable('avcpp_dep') +if not get_option('build_samples') + subdir_done() +endif + samples = [ 'api2-decode', 'api2-decode-encode-video', diff --git a/meson.build b/meson.build index 7565c9e1..814a0705 100644 --- a/meson.build +++ b/meson.build @@ -4,25 +4,21 @@ project( meson_version: '>= 0.54.0', default_options : [ 'c_std=c11', - 'cpp_std=c++17' + 'cpp_std=c++17', + 'build_tests=@0@'.format(not meson.is_subproject()), + 'build_samples=@0@'.format(not meson.is_subproject()), ], version: '2.0.99', ) -if not meson.is_subproject() - subdir('src') +subdir('src') +subdir('example/api2-samples') +subdir('tests') - if get_option('build_samples') - subdir('example/api2-samples') - endif +meson.override_dependency('avcpp', avcpp_dep) - if get_option('build_tests') - subdir('tests') - endif -else - subdir('src') -endif - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('avcpp', avcpp_dep) -endif +summary({ + 'Build samples' : get_option('build_samples'), + 'Build tests' : get_option('build_tests') + }, section: 'Extra', bool_yn: true, +) diff --git a/tests/meson.build b/tests/meson.build index e2dfbbeb..96b80a37 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,4 +1,9 @@ #get catch2 + +if not get_option('build_tests') + subdir_done() +endif + catch2 = dependency('catch2', required: true, fallback:['catch2','catch2_dep']) #create main_test as library and export the dependency From 179986cfbf3e6212493315447cc82558cbbc723e Mon Sep 17 00:00:00 2001 From: Piotr Rak Date: Thu, 24 Sep 2020 23:00:50 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60fd3005..200f4814 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ You can read the full documentation [here](https://h4tr3d.github.io/avcpp/). - libswresample >= 0.x.x - libpostproc >= 52.x.x - GCC >= 5.0 (C++11 is required) -- CMake (> 3.11) or Meson(> 50.0) +- CMake (> 3.11) or Meson(>= 0.54.0) ### Debian, Ubuntu 19.10 and Linux Mint 20.x or newer