aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2016-04-09 23:53:26 +0100
committerTim-Philipp Müller <tim@centricular.com>2018-12-15 20:16:03 +0000
commit4b50f5b638015556d93771269258e6894b6b757f (patch)
tree6f3a80f02b0102dbb01434d0e49a7ff83dee15aa
parent1c13f7cbe1ebee24c2b62d5ba16f2702882da49a (diff)
Add support for Meson as build system
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
-rw-r--r--examples/meson.build8
-rw-r--r--include/tinyalsa/meson.build10
-rw-r--r--meson.build29
-rw-r--r--meson_options.txt6
-rw-r--r--utils/meson.build9
5 files changed, 62 insertions, 0 deletions
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 0000000..59a48a1
--- /dev/null
+++ b/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
diff --git a/include/tinyalsa/meson.build b/include/tinyalsa/meson.build
new file mode 100644
index 0000000..d14b35b
--- /dev/null
+++ b/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')
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..e09a8be
--- /dev/null
+++ b/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')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..f2e2bc2
--- /dev/null
+++ b/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')
diff --git a/utils/meson.build b/utils/meson.build
new file mode 100644
index 0000000..934402b
--- /dev/null
+++ b/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