aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-08-17 12:47:55 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-08-21 06:30:21 -0400
commit478e943f515bffb712ff65a85b5db36c90a2f5e7 (patch)
tree500e8167a2136e49e7a17ef19f5ab518d8cdbeb8 /audio
parenta2ce7dbd917a18408cf4bfd132578b46c2752a72 (diff)
meson: convert audio directory to Meson
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/Makefile.objs35
-rw-r--r--audio/meson.build30
2 files changed, 30 insertions, 35 deletions
diff --git a/audio/Makefile.objs b/audio/Makefile.objs
deleted file mode 100644
index b4a4c11f31..0000000000
--- a/audio/Makefile.objs
+++ /dev/null
@@ -1,35 +0,0 @@
-common-obj-y = audio.o audio_legacy.o noaudio.o wavaudio.o mixeng.o
-common-obj-$(CONFIG_SPICE) += spiceaudio.o
-common-obj-$(CONFIG_AUDIO_COREAUDIO) += coreaudio.o
-common-obj-$(CONFIG_AUDIO_DSOUND) += dsoundaudio.o
-common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
-common-obj-y += wavcapture.o
-
-coreaudio.o-libs := $(COREAUDIO_LIBS)
-dsoundaudio.o-libs := $(DSOUND_LIBS)
-
-# alsa module
-common-obj-$(CONFIG_AUDIO_ALSA) += alsa.mo
-alsa.mo-objs = alsaaudio.o
-alsa.mo-libs := $(ALSA_LIBS)
-
-# oss module
-common-obj-$(CONFIG_AUDIO_OSS) += oss.mo
-oss.mo-objs = ossaudio.o
-oss.mo-libs := $(OSS_LIBS)
-
-# pulseaudio module
-common-obj-$(CONFIG_AUDIO_PA) += pa.mo
-pa.mo-objs = paaudio.o
-pa.mo-libs := $(PULSE_LIBS)
-
-# sdl module
-common-obj-$(CONFIG_AUDIO_SDL) += sdl.mo
-sdl.mo-objs = sdlaudio.o
-sdl.mo-cflags := $(SDL_CFLAGS)
-sdl.mo-libs := $(SDL_LIBS)
-
-# jack module
-common-obj-$(CONFIG_AUDIO_JACK) += jack.mo
-jack.mo-objs = jackaudio.o
-jack.mo-libs := $(JACK_LIBS)
diff --git a/audio/meson.build b/audio/meson.build
new file mode 100644
index 0000000000..15c06ba045
--- /dev/null
+++ b/audio/meson.build
@@ -0,0 +1,30 @@
+softmmu_ss.add(files(
+ 'audio.c',
+ 'audio_legacy.c',
+ 'mixeng.c',
+ 'noaudio.c',
+ 'wavaudio.c',
+ 'wavcapture.c',
+))
+
+softmmu_ss.add(when: [spice, 'CONFIG_SPICE'], if_true: files('spiceaudio.c'))
+softmmu_ss.add(when: [coreaudio, 'CONFIG_AUDIO_COREAUDIO'], if_true: files('coreaudio.c'))
+softmmu_ss.add(when: [dsound, 'CONFIG_AUDIO_DSOUND'], if_true: files('dsoundaudio.c'))
+softmmu_ss.add(when: ['CONFIG_AUDIO_WIN_INT'], if_true: files('audio_win_int.c'))
+
+audio_modules = {}
+foreach m : [
+ ['CONFIG_AUDIO_ALSA', 'alsa', alsa, 'alsaaudio.c'],
+ ['CONFIG_AUDIO_OSS', 'oss', oss, 'ossaudio.c'],
+ ['CONFIG_AUDIO_PA', 'pa', pulse, 'paaudio.c'],
+ ['CONFIG_AUDIO_SDL', 'sdl', sdl, 'sdlaudio.c'],
+ ['CONFIG_AUDIO_JACK', 'jack', jack, 'jackaudio.c']
+]
+ if config_host.has_key(m[0])
+ module_ss = ss.source_set()
+ module_ss.add(when: m[2], if_true: files(m[3]))
+ audio_modules += {m[1] : module_ss}
+ endif
+endforeach
+
+modules += {'audio': audio_modules}