meson: Fix generation of pkgconfig files
Too much information was specified manually. All this is deduced automatically if you specify the library as the first positional argument. Only absl_base needs to be in Requires: because absl_optional's header file is needed at build time. Also add a check in the CI for the pc files being usable.
This commit is contained in:
parent
c9b0a675e4
commit
0691ae20d8
@ -83,8 +83,12 @@ build-container-aarch64:
|
|||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
script:
|
script:
|
||||||
- meson setup --wrap-mode=nofallback builddir
|
- meson setup --wrap-mode=nofallback --prefix=/usr --libdir=lib builddir
|
||||||
- ninja -C builddir
|
- ninja -C builddir
|
||||||
|
- DESTDIR=$PWD/_install ninja install -C builddir
|
||||||
|
# Test that the pc files are usable
|
||||||
|
- PKG_CONFIG_PATH=$PWD/_install/usr/lib/pkgconfig pkg-config --cflags --libs webrtc-audio-processing-1
|
||||||
|
- PKG_CONFIG_PATH=$PWD/_install/usr/lib/pkgconfig pkg-config --cflags --libs webrtc-audio-coding-1
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: '5 days'
|
expire_in: '5 days'
|
||||||
when: 'always'
|
when: 'always'
|
||||||
@ -96,8 +100,12 @@ build-container-aarch64:
|
|||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
script:
|
script:
|
||||||
- meson setup --force-fallback-for=abseil-cpp builddir
|
- meson setup --force-fallback-for=abseil-cpp --prefix=/usr --libdir=lib builddir
|
||||||
- ninja -C builddir
|
- ninja -C builddir
|
||||||
|
- DESTDIR=$PWD/_install ninja install -C builddir
|
||||||
|
# Test that the pc files are usable
|
||||||
|
- PKG_CONFIG_LIBDIR=$PWD/_install/usr/lib/pkgconfig pkg-config --cflags --libs webrtc-audio-processing-1
|
||||||
|
- PKG_CONFIG_LIBDIR=$PWD/_install/usr/lib/pkgconfig pkg-config --cflags --libs webrtc-audio-coding-1
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: '5 days'
|
expire_in: '5 days'
|
||||||
when: 'always'
|
when: 'always'
|
||||||
|
22
meson.build
22
meson.build
@ -19,12 +19,10 @@ minor_version = version_split[1]
|
|||||||
|
|
||||||
apm_major_version = major_version
|
apm_major_version = major_version
|
||||||
apm_minor_version = minor_version
|
apm_minor_version = minor_version
|
||||||
apm_version = apm_major_version + '.' + apm_minor_version
|
|
||||||
apm_project_name = 'webrtc-audio-processing-' + apm_major_version
|
apm_project_name = 'webrtc-audio-processing-' + apm_major_version
|
||||||
|
|
||||||
ac_major_version = major_version
|
ac_major_version = major_version
|
||||||
ac_minor_version = minor_version
|
ac_minor_version = minor_version
|
||||||
ac_version = ac_major_version + '.' + ac_minor_version
|
|
||||||
ac_project_name = 'webrtc-audio-coding-' + ac_major_version
|
ac_project_name = 'webrtc-audio-coding-' + ac_major_version
|
||||||
|
|
||||||
include_subdir = apm_project_name
|
include_subdir = apm_project_name
|
||||||
@ -72,6 +70,9 @@ if absl_dep[0].type_name() == 'internal'
|
|||||||
absl_subproj.get_variable('absl_types_headers'),
|
absl_subproj.get_variable('absl_types_headers'),
|
||||||
]
|
]
|
||||||
install_headers(headers, preserve_path: true)
|
install_headers(headers, preserve_path: true)
|
||||||
|
pc_requires = []
|
||||||
|
else
|
||||||
|
pc_requires = [absl_dep[0]]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ['darwin', 'ios'].contains(host_system)
|
if ['darwin', 'ios'].contains(host_system)
|
||||||
@ -176,21 +177,13 @@ subdir('webrtc')
|
|||||||
pkgconfig = import('pkgconfig')
|
pkgconfig = import('pkgconfig')
|
||||||
|
|
||||||
pkgconfig.generate(
|
pkgconfig.generate(
|
||||||
name: apm_project_name,
|
libwebrtc_audio_processing,
|
||||||
description: 'WebRTC Audio Processing library',
|
description: 'WebRTC Audio Processing library',
|
||||||
version: apm_major_version + '.' + apm_minor_version,
|
|
||||||
filebase: apm_project_name,
|
|
||||||
subdirs: include_subdir,
|
subdirs: include_subdir,
|
||||||
|
requires: pc_requires,
|
||||||
extra_cflags: [
|
extra_cflags: [
|
||||||
'-DWEBRTC_LIBRARY_IMPL',
|
'-DWEBRTC_LIBRARY_IMPL',
|
||||||
] + platform_cflags,
|
] + platform_cflags,
|
||||||
libraries: [
|
|
||||||
libwebrtc_audio_processing,
|
|
||||||
],
|
|
||||||
requires: [
|
|
||||||
# the audio processing header references absl's optional.h
|
|
||||||
'absl_base',
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
audio_processing_dep = declare_dependency(
|
audio_processing_dep = declare_dependency(
|
||||||
@ -202,15 +195,12 @@ audio_processing_dep = declare_dependency(
|
|||||||
meson.override_dependency(apm_project_name, audio_processing_dep)
|
meson.override_dependency(apm_project_name, audio_processing_dep)
|
||||||
|
|
||||||
pkgconfig.generate(
|
pkgconfig.generate(
|
||||||
name: ac_project_name,
|
libwebrtc_audio_coding,
|
||||||
description: 'WebRTC Audio Coding library',
|
description: 'WebRTC Audio Coding library',
|
||||||
version: ac_major_version + '.' + ac_minor_version,
|
|
||||||
filebase: ac_project_name,
|
|
||||||
subdirs: include_subdir,
|
subdirs: include_subdir,
|
||||||
extra_cflags: [
|
extra_cflags: [
|
||||||
'-DWEBRTC_LIBRARY_IMPL',
|
'-DWEBRTC_LIBRARY_IMPL',
|
||||||
] + platform_cflags,
|
] + platform_cflags,
|
||||||
libraries: libwebrtc_audio_coding,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
audio_coding_dep = declare_dependency(
|
audio_coding_dep = declare_dependency(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user