From c4301cf4ec66996163a5e506bc0230d1ad94dc67 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 21 Aug 2022 15:08:19 -0700 Subject: [PATCH] Disable FAudio debug configuration in Release mode Whereas all `SDL_assert`s will go away when compiling with optimization flags and all plain `assert` calls (used in PhysFS) will go away when compiling in Release mode, FAudio has a bunch of debug stuff that needs to be explicitly disabled with its own `FAUDIO`-prefixed flag. To do this in Release mode, we need to use generator expressions for dumb CMake reasons. Basically, if checking the CMAKE_BUILD_TYPE variable will not work for certain generators (Ninja, Visual Studio) because they only specify the build type at build time, not generation/configuration time. --- desktop_version/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 124bc192..c1e1b109 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -312,6 +312,8 @@ if(BUNDLE_DEPENDENCIES) faudio-static PRIVATE ../third_party/FAudio/include ) + # Disable FAudio debug stuff in release mode. This needs a generator expression for CMake reasons(TM) + target_compile_definitions(faudio-static PRIVATE $<$:FAUDIO_DISABLE_DEBUGCONFIGURATION>) target_link_libraries(VVVVVV ${STATIC_LIBRARIES}) else()