Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions example/api2-samples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
28 changes: 12 additions & 16 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently has slight semantic difference, since meson will be visiting 'example/api2-samples' subdirectory, it will be created in build directory when using non flat layout. Dunno if this mkdir is a concern, or not, but guess I should mention it.

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,
)
5 changes: 5 additions & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
@@ -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
Expand Down