From 1d85c9d2010d0a9b905b88cedcc62a4036cfa00b Mon Sep 17 00:00:00 2001 From: p01arst0rm Date: Mon, 12 Jul 2021 21:40:51 +0100 Subject: [PATCH] fix shared FAudio build --- 3rdparty/CMakeLists.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 24c3000ae0..356e52bf4c 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -222,17 +222,20 @@ add_subdirectory(OpenAL EXCLUDE_FROM_ALL) # FAudio set(FAUDIO_TARGET 3rdparty_dummy_lib) if(USE_FAUDIO) + # FAudio depends on SDL2 + find_package(SDL2) + if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.9) + message(FATAL_ERROR "-- RPCS3: FAudio requires SDL 2.0.9 or newer.") + endif() if (USE_SYSTEM_FAUDIO) - find_package(FAudio-config) - target_compile_definitions(FAudio INTERFACE -DHAVE_FAUDIO) - set(FAUDIO_TARGET FAudio) + message(STATUS "RPCS3: Using system FAudio") + find_package(FAudio REQUIRED CONFIGS FAudio-config.cmake) + add_library(3rdparty_FAudio INTERFACE) + target_link_libraries(3rdparty_FAudio INTERFACE FAudio) + target_compile_definitions(3rdparty_FAudio INTERFACE -DHAVE_FAUDIO) + set(FAUDIO_TARGET 3rdparty_FAudio) else() - # FAudio depends on SDL2 - find_package(SDL2) - if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.9) - message(FATAL_ERROR "-- RPCS3: FAudio requires SDL 2.0.9 or newer.") - endif() - + message(STATUS "RPCS3: Using builtin FAudio") set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared library") add_subdirectory(FAudio EXCLUDE_FROM_ALL) target_compile_definitions(FAudio INTERFACE -DHAVE_FAUDIO)