Skip to content

Commit

Permalink
Add support for Meson as build system
Browse files Browse the repository at this point in the history
The Meson build system is being adopted by projects
such as GNOME, PulseAudio, GStreamer, VLC, systemd, Mesa,
Wayland, X.org, and many others. Having a meson build
upstream in tinyalsa would allow for easy use of tinyalsa
as a Meson subproject in other projects.

https://mesonbuild.com
  • Loading branch information
tp-m committed Dec 15, 2018
1 parent 1c13f7c commit 4b50f5b
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/meson.build
@@ -0,0 +1,8 @@
examples = ['pcm-readi', 'pcm-writei']

foreach e : examples
executable(e, '@0@.c'.format(e),
include_directories: tinyalsa_includes,
link_with: tinyalsa,
install: false)
endforeach
10 changes: 10 additions & 0 deletions include/tinyalsa/meson.build
@@ -0,0 +1,10 @@
tinyalsa_headers = [
'asoundlib.h',
'interval.h',
'limits.h',
'mixer.h',
'pcm.h',
'version.h'
]

install_headers(tinyalsa_headers, subdir: 'tinyalsa')
29 changes: 29 additions & 0 deletions meson.build
@@ -0,0 +1,29 @@
project ('tinyalsa', 'c', version : '1.1.1', meson_version : '>= 0.48.0')

tinyalsa_includes = include_directories('.', 'include')

tinyalsa = library('tinyalsa',
'src/mixer.c', 'src/pcm.c',
include_directories: tinyalsa_includes,
install: true)

# For use as a Meson subproject
tinyalsa_dep = declare_dependency(link_with: tinyalsa,
include_directories: include_directories('include'))

if not get_option('docs').disabled()
# subdir('docs') # FIXME
endif

if not get_option('examples').disabled()
subdir('examples')
endif

subdir('include/tinyalsa')

if not get_option('utils').disabled()
subdir('utils')
endif

pkg = import('pkgconfig')
pkg.generate(tinyalsa, description: 'TinyALSA Library')
6 changes: 6 additions & 0 deletions meson_options.txt
@@ -0,0 +1,6 @@
option('docs', type: 'feature', value: 'auto', yield: true,
description : 'Generate documentation with Doxygen')
option('examples', type: 'feature', value: 'auto', yield: true,
description : 'Build examples')
option('utils', type: 'feature', value: 'auto', yield: true,
description : 'Build utility tools')
9 changes: 9 additions & 0 deletions utils/meson.build
@@ -0,0 +1,9 @@
utils = ['tinyplay', 'tinycap', 'tinymix', 'tinypcminfo']

foreach util : utils
executable(util, '@0@.c'.format(util),
include_directories: tinyalsa_includes,
link_with: tinyalsa,
install: true)
install_man('@0@.1'.format(util))
endforeach

0 comments on commit 4b50f5b

Please sign in to comment.