meson: add DirectSound detection

This commit is contained in:
Ryan Lucia 2019-02-17 12:25:57 -05:00
parent 9aeaceb6e7
commit 9e284660b1
3 changed files with 19 additions and 1 deletions

View file

@ -82,6 +82,21 @@ foreach dep: [
endif
endforeach
if host_machine.system() == 'windows' and not get_option('directsound').disabled()
dsound_dep = cc.find_library('dsound', required: get_option('directsound'))
winmm_dep = cc.find_library('winmm', required: get_option('directsound'))
ole32_dep = cc.find_library('ole32', required: get_option('directsound'))
have_dsound_h = cc.has_header('dsound.h')
if not have_dsound_h and get_option('directsound').enabled()
error('DirectSound enabled but dsound.h not found')
endif
if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and have_dsound_h
deps += [dsound_dep, winmm_dep, ole32_dep]
conf.set('WITH_DIRECTSOUND', '1')
dep_avail += 'DirectSound'
endif
endif
# TODO: OSS
def_audio = get_option('default_audio_output')

View file

@ -2,7 +2,8 @@ option('alsa', type: 'feature', description: 'ALSA audio output')
option('openal', type: 'feature', description: 'OpenAL audio output')
option('libpulse', type: 'feature', description: 'PulseAudio audio output')
option('portaudio', type: 'feature', description: 'PortAudio audio output')
option('default_audio_output', type: 'combo', choices: ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio'], description: 'Default audio output')
option('directsound', type: 'feature', description: 'DirectSound audio output')
option('default_audio_output', type: 'combo', choices: ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio', 'DirectSound'], description: 'Default audio output')
option('ffms2', type: 'feature', description: 'FFMS2 video source')

View file

@ -181,6 +181,8 @@ opt_src = [
['PulseAudio', 'audio_player_pulse.cpp'],
['OpenAL', 'audio_player_openal.cpp'],
['OSS', 'audio_player_oss.cpp'],
['DirectSound', ['audio_player_dsound.cpp',
'audio_player_dsound2.cpp']],
['FFMS2', ['audio_provider_ffmpegsource.cpp',
'video_provider_ffmpegsource.cpp',