Skip to content

Commit ca901e6

Browse files
xclaessejmvalin
authored andcommitted
meson: Use pkgconfig generator
It is much less error prone because Meson can detect dependencies automatically. As bonus Meson will also generate the opus-uninstalled.pc file. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
1 parent e7d4e82 commit ca901e6

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

meson.build

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -662,29 +662,11 @@ if not opt_tests.disabled()
662662
subdir('tests')
663663
endif
664664

665-
# pkg-config files (not using pkg module so we can use the existing .pc.in file)
666-
pkgconf = configuration_data()
667-
668-
pkgconf.set('prefix', join_paths(get_option('prefix')))
669-
pkgconf.set('exec_prefix', '${prefix}')
670-
pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
671-
pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
672-
pkgconf.set('VERSION', opus_version)
673-
pkgconf.set('PC_BUILD', pc_build)
674-
pkgconf.set('LIBM', libm.found() ? '-lm' : '')
675-
676-
pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
677-
678-
configure_file(input : 'opus.pc.in',
679-
output : 'opus.pc',
680-
configuration : pkgconf,
681-
install_dir : pkg_install_dir)
682-
683-
# The uninstalled one has hardcoded libtool + static lib stuff, skip it for now
684-
#configure_file(input : 'opus-uninstalled.pc.in',
685-
# output : 'opus-uninstalled.pc',
686-
# configuration : pkgconf,
687-
# install : false)
665+
pkg = import('pkgconfig')
666+
pkg.generate(opus_lib,
667+
description: 'Opus IETF audio codec (floating-point build)',
668+
subdirs: 'opus',
669+
)
688670

689671
doxygen = find_program('doxygen', required: get_option('docs'))
690672
if doxygen.found()

0 commit comments

Comments
 (0)