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 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 ae6e1ec9..814a0705 100644 --- a/meson.build +++ b/meson.build @@ -1,28 +1,24 @@ project( 'avcpp', 'cpp', - meson_version: '>= 0.50.0', + 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