Commit 21d78a42 authored by Arun Raghavan's avatar Arun Raghavan
Browse files

build: Make packages versioned

Since we cannot rely on the API to be stable upstream, let's start
making the pkg-config, library, and include dir have a version suffix.
This will allow different downstream projects depending on us to
independently switch versions without packagers having to jump through
hoops.
parent bcec8b0b
project('webrtc-audio-processing', 'c', 'cpp',
version : '0.4.0',
project('webrtc-audio-processing-1', 'c', 'cpp',
version : '1.0',
meson_version : '>= 0.52',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized',
......@@ -8,7 +8,26 @@ project('webrtc-audio-processing', 'c', 'cpp',
]
)
soversion = 0
version_split = meson.project_version().split('.')
# This will be incremented each time a breaking API change occurs
major_version = version_split[0]
# This will be incremented when there are backwards-compatible changes
minor_version = version_split[1]
# We maintain per-package versions to not have to break API for one if only the
# other has breaking changes
apm_major_version = major_version
apm_minor_version = minor_version
apm_version = apm_major_version + '.' + apm_minor_version
apm_project_name = 'webrtc-audio-processing-' + apm_major_version
ac_major_version = major_version
ac_minor_version = minor_version
ac_version = ac_major_version + '.' + ac_minor_version
ac_project_name = 'webrtc-audio-coding-' + ac_major_version
include_subdir = meson.project_name()
cc = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')
......@@ -131,11 +150,11 @@ subdir('webrtc')
pkgconfig = import('pkgconfig')
pkgconfig.generate(
name: 'webrtc-audio-processing',
name: apm_project_name,
description: 'WebRTC Audio Processing library',
version: meson.project_version(),
filebase: 'webrtc-audio-processing',
subdirs: 'webrtc_audio_processing',
version: apm_major_version + '.' + apm_minor_version,
filebase: apm_project_name,
subdirs: include_subdir,
extra_cflags: [
'-DWEBRTC_LIBRARY_IMPL',
] + platform_cflags,
......@@ -143,11 +162,11 @@ pkgconfig.generate(
)
pkgconfig.generate(
name: 'webrtc-audio-coding',
name: ac_project_name,
description: 'WebRTC Audio Coding library',
version: meson.project_version(),
filebase: 'webrtc-audio-coding',
subdirs: 'webrtc_audio_processing',
version: ac_major_version + '.' + ac_minor_version,
filebase: ac_project_name,
subdirs: include_subdir,
extra_cflags: [
'-DWEBRTC_LIBRARY_IMPL',
] + platform_cflags,
......
......@@ -28,7 +28,7 @@ api_headers = [
foreach h : api_headers
install_headers(
join_paths(h[0], h[1]),
subdir: join_paths('webrtc_audio_processing', 'api', h[0])
subdir: join_paths(include_subdir, 'api', h[0])
)
endforeach
......
......@@ -30,30 +30,30 @@ webrtc_audio_coding_sources = [
'codecs/isac/main/source/transform.c',
]
libwebrtc_audio_coding = library('webrtc_audio_coding',
libwebrtc_audio_coding = library(ac_project_name,
webrtc_audio_coding_sources,
dependencies: [base_dep, api_dep, common_audio_dep, system_wrappers_dep, fft_dep] + common_deps,
include_directories: webrtc_inc,
c_args: common_cflags,
cpp_args: common_cxxflags,
soversion: soversion,
soversion: ac_minor_version,
install: true
)
webrtc_audio_coding_dep = declare_dependency(
link_with: libwebrtc_audio_coding,
include_directories: webrtc_inc,
version: meson.project_version()
version: ac_version
)
install_headers(['codecs/isac/bandwidth_info.h'],
subdir: 'webrtc_audio_processing/modules/audio_coding/codecs/isac'
subdir: join_paths(include_subdir, 'modules', 'audio_coding', 'codecs', 'isac')
)
install_headers(['codecs/isac/main/source/settings.h'],
subdir: 'webrtc_audio_processing/modules/audio_coding/codecs/isac/main/source'
subdir: join_paths(include_subdir, 'modules', 'audio_coding', 'codecs', 'isac', 'main', 'source')
)
install_headers(['codecs/isac/main/include/isac.h'],
subdir: 'webrtc_audio_processing/modules/audio_coding/codecs/isac/main/include'
subdir: join_paths(include_subdir, 'modules', 'audio_coding', 'codecs', 'isac', 'main', 'include')
)
......@@ -191,10 +191,10 @@ if have_neon
endif
install_headers(webrtc_audio_processing_include_headers,
subdir: 'webrtc_audio_processing/modules/audio_processing/include'
subdir: join_paths(include_subdir, 'modules', 'audio_processing', 'include')
)
libwebrtc_audio_processing = library('webrtc_audio_processing',
libwebrtc_audio_processing = library(apm_project_name,
webrtc_audio_processing_sources,
dependencies: [
base_dep,
......@@ -209,12 +209,12 @@ libwebrtc_audio_processing = library('webrtc_audio_processing',
include_directories: webrtc_inc,
c_args: common_cflags + apm_flags,
cpp_args: common_cxxflags + apm_flags,
soversion: soversion,
soversion: apm_minor_version,
install: true
)
webrtc_audio_processing_dep = declare_dependency(
link_with: libwebrtc_audio_processing,
include_directories: webrtc_inc,
version: meson.project_version()
version: apm_version
)
......@@ -47,7 +47,7 @@ endif
foreach h : base_headers
install_headers(
join_paths(h[0], h[1]),
subdir: join_paths('webrtc_audio_processing', 'rtc_base', h[0])
subdir: join_paths(include_subdir, 'rtc_base', h[0])
)
endforeach
......
......@@ -12,7 +12,7 @@ system_headers = [
]
install_headers(system_headers,
subdir: 'webrtc_audio_processing/system_wrappers/include'
subdir: join_paths(include_subdir, 'system_wrappers', 'include')
)
libsystem_wrappers = static_library('system_wrappers',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment