Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 2 additions & 2 deletions .github/workflows/cmake-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
include:
- os: ubuntu-22.04
build_type: Release
skip_meson: true
skip_meson: false
- os: ubuntu-22.04
build_type: Debug
skip_meson: true
skip_meson: false


# The CMake configure and build commands are platform agnostic and should work equally
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required (VERSION 3.19)

# Declare here
set (AVCPP_VERSION 3.0.1)
# Declare the version version.txt
file(READ "VERSION.txt" AVCPP_VERSION)
string(STRIP "${AVCPP_VERSION}" AVCPP_VERSION)

if(NOT DEFINED PROJECT_NAME)
set(AVCPP_NOT_SUBPROJECT ON)
Expand Down
1 change: 1 addition & 0 deletions VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.2
14 changes: 5 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
project(
'avcpp',
'cpp',
meson_version: '>= 0.50.0',
meson_version: '>= 0.54.1',
default_options : [
'c_std=c11',
'cpp_std=c++17'
'cpp_std=c++20'
],
version: '2.4.0',
version: files('VERSION.txt'),
)

subdir('src/avcpp')
if not meson.is_subproject()
subdir('src')

if get_option('build_samples')
subdir('example/api2-samples')
Expand All @@ -19,10 +19,6 @@ if not meson.is_subproject()
# 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
meson.override_dependency('avcpp', avcpp_dep)
49 changes: 42 additions & 7 deletions src/avcpp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ if meson.project_name() == ''
project(
'avcpp',
'cpp',
meson_version: '>= 0.50.0',
meson_version: '>= 0.54.1',
default_options : [
'c_std=c11',
'cpp_std=c++17'
'cpp_std=c++20'
],
version: '2.4.0',
version: files('VERSION.txt'),
)
endif

Expand Down Expand Up @@ -35,18 +35,52 @@ av_libs = [
['postproc', '52.0.0'],
]

conf_data = configuration_data()
cpp_std = get_option('cpp_std')
if cpp_std in ['c++17', 'gnu++17', 'vc++17']
conf_data.set('AVCPP_CXX_STANDARD', '17')
elif cpp_std in ['c++20', 'gnu++20', 'vc++20']
conf_data.set('AVCPP_CXX_STANDARD', '20')
elif cpp_std in ['c++23', 'gnu++23', 'vc++23']
conf_data.set('AVCPP_CXX_STANDARD', '23')
elif cpp_std in ['c++26', 'gnu++26', 'vc++26']
conf_data.set('AVCPP_CXX_STANDARD', '26')
else
warning('C++ standard setting ', cpp_std, ' not recognized')
endif

foreach lib : av_libs
avcpp_deps += [
dependency(
lib_dep = dependency(
'lib@0@'.format(lib[0]),
required: true,
fallback : ['ffmpeg', 'lib@0@_dep'.format(lib[0])],
version : '>=@0@'.format(lib[1]))
]
avcpp_deps += [ lib_dep ]
lib_version = lib_dep.version().split('.')
conf_data.set(
'AVCPP_' + lib[0].to_upper() + '_VERSION_MAJOR',
lib_version[0])
conf_data.set(
'AVCPP_' + lib[0].to_upper() + '_VERSION_MINOR',
lib_version[1])
conf_data.set(
'AVCPP_' + lib[0].to_upper() + '_VERSION_PATCH',
lib_version[2])
conf_data.set(
'AVCPP_' + lib[0].to_upper() + '_VERSION_TWEAK',
'0')
endforeach

configure_file(input : 'avconfig.h.in',
output : 'avconfig.h',
configuration : conf_data,
format: 'cmake',
install: true,
install_dir: 'include/avcpp'
)

#setting the include dir to the current folder (src)
avcpp_incdir = include_directories('.','filters')
avcpp_incdir = include_directories('.','filters','..')

#listing all the source files
avcpp_sources = [
Expand All @@ -58,6 +92,7 @@ avcpp_sources = [
'codeccontext.cpp',
'codec.cpp',
'codecparameters.cpp',
'buffer.cpp',
'dictionary.cpp',
'formatcontext.cpp',
'format.cpp',
Expand Down
Loading