summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2018-01-26 10:08:09 +0100
committerIñigo Martínez <inigomartinez@gmail.com>2018-01-26 10:47:08 +0100
commit67533bffdcd22893b28baa411b2e75bd75dce323 (patch)
tree52b6606b097d1daa9f563490adf567b486748bb1
parent9a2996b3626713df80e62b42721f94a5e20e2958 (diff)
downloadlibgnome-volume-control-67533bffdcd22893b28baa411b2e75bd75dce323.tar.gz
build: Make ALSA support optional
ALSA support is not mandatory for libgnome-volume-control, but it can not be made optional. This patch makes the ALSA support optional by using an option. https://bugzilla.gnome.org/show_bug.cgi?id=792919
-rw-r--r--meson.build23
-rw-r--r--meson_options.txt6
2 files changed, 19 insertions, 10 deletions
diff --git a/meson.build b/meson.build
index d719398..68386c3 100644
--- a/meson.build
+++ b/meson.build
@@ -12,7 +12,6 @@ gnome = import('gnome')
pkglibdir = get_option('pkglibdir')
pkgdatadir = get_option('pkgdatadir')
-alsa = dependency('alsa', required: false)
gio = dependency('gio-2.0')
gobject = dependency('gobject-2.0')
libpulse = dependency('libpulse', version: '>= 2.0')
@@ -21,13 +20,6 @@ libpulse_glib = dependency('libpulse-mainloop-glib')
cdata = configuration_data()
cdata.set_quoted('GETTEXT_PACKAGE', get_option('package-name'))
cdata.set_quoted('PACKAGE_VERSION', get_option('package-version'))
-cdata.set('HAVE_ALSA', alsa.found())
-
-config = configure_file(
- input: 'config.h.meson',
- output: 'config.h',
- configuration: cdata
-)
libgvc_inc = include_directories('.')
@@ -63,13 +55,18 @@ libgvc_no_gir_sources = [
]
libgvc_deps = [
- alsa,
gio,
gobject,
libpulse,
libpulse_glib
]
+enable_alsa = get_option('alsa')
+if enable_alsa
+ libgvc_deps += dependency('alsa')
+endif
+cdata.set('HAVE_ALSA', enable_alsa)
+
static = get_option('static')
with_introspection = get_option('with-introspection')
@@ -129,7 +126,7 @@ if with_introspection
)
endif
-if alsa.found()
+if enable_alsa
executable('test-audio-device-selection',
sources: 'test-audio-device-selection.c',
link_with: libgvc,
@@ -143,3 +140,9 @@ libgvc_dep = declare_dependency(
include_directories: libgvc_inc,
dependencies: libgvc_deps
)
+
+config = configure_file(
+ input: 'config.h.meson',
+ output: 'config.h',
+ configuration: cdata
+)
diff --git a/meson_options.txt b/meson_options.txt
index aa802b6..379a6c7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -22,6 +22,12 @@ option('pkgdatadir',
description: 'The private directory the gir file will be installed into.'
)
+option('alsa',
+ type: 'boolean',
+ value: true,
+ description: 'Build ALSA support.'
+)
+
option('static',
type: 'boolean',
value: false,