From c036a9ff86808b654d80412dda140636807814c4 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 22 Aug 2025 11:12:44 +1000 Subject: [PATCH] Try fixing errors when SDL2 is not found. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89322b59..03a13037 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -395,6 +395,12 @@ else() message(STATUS "SDL2 not found. SDL2 examples will be excluded.") endif() +# If SDL2 was not found, and we're not using runtime linking, we'll have to disable SDL2 support in tests. +if(MINIAUDIO_NO_RUNTIME_LINKING AND NOT HAS_SDL2) + list(APPEND COMPILE_DEFINES MA_NO_SDL) +endif() + + # SteamAudio has an annoying SDK setup. In the lib folder there is a folder for each platform. We need to specify the # platform we're compiling for. if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")