diff --git a/cmake/Options.cmake b/cmake/Options.cmake index 4b8ac851..2b84d6b3 100644 --- a/cmake/Options.cmake +++ b/cmake/Options.cmake @@ -140,7 +140,17 @@ if(WIN32) option(ENABLE_XAUDIO2 "Enable xaudio2 sound output for the wxWidgets port" ${XAUDIO2_DEFAULT}) 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) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index c92b3742..2360138f 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -324,7 +324,6 @@ endif() # FAudio. if(ENABLE_FAUDIO) - find_package(FAudio REQUIRED) target_sources(visualboyadvance-m PRIVATE faudio.cpp) target_link_libraries(visualboyadvance-m FAudio::FAudio) target_compile_definitions(visualboyadvance-m PRIVATE VBAM_ENABLE_FAUDIO)