build: enable FAudio sound driver on Windows

Enable FAudio on Windows if cmake can find it.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2024-04-06 11:22:20 +00:00
parent 775a571f75
commit ff21f8da21
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 11 additions and 2 deletions

View File

@ -140,7 +140,17 @@ if(WIN32)
option(ENABLE_XAUDIO2 "Enable xaudio2 sound output for the wxWidgets port" ${XAUDIO2_DEFAULT}) option(ENABLE_XAUDIO2 "Enable xaudio2 sound output for the wxWidgets port" ${XAUDIO2_DEFAULT})
endif() endif()
option(ENABLE_FAUDIO "Enable FAudio sound output for the wxWidgets port" OFF) set(ENABLE_FAUDIO_DEFAULT OFF)
if(WIN32)
find_package(FAudio)
if(FAudio_FOUND)
set(ENABLE_FAUDIO_DEFAULT ON)
endif()
endif()
option(ENABLE_FAUDIO "Enable FAudio sound output for the wxWidgets port" ${ENABLE_FAUDIO_DEFAULT})
option(ZIP_SUFFIX [=[suffix for release zip files, e.g. "-somebranch".zip]=] OFF) option(ZIP_SUFFIX [=[suffix for release zip files, e.g. "-somebranch".zip]=] OFF)

View File

@ -324,7 +324,6 @@ endif()
# FAudio. # FAudio.
if(ENABLE_FAUDIO) if(ENABLE_FAUDIO)
find_package(FAudio REQUIRED)
target_sources(visualboyadvance-m PRIVATE faudio.cpp) target_sources(visualboyadvance-m PRIVATE faudio.cpp)
target_link_libraries(visualboyadvance-m FAudio::FAudio) target_link_libraries(visualboyadvance-m FAudio::FAudio)
target_compile_definitions(visualboyadvance-m PRIVATE VBAM_ENABLE_FAUDIO) target_compile_definitions(visualboyadvance-m PRIVATE VBAM_ENABLE_FAUDIO)