From ade829d7caa0b11831220ba4cfda2face8032687 Mon Sep 17 00:00:00 2001 From: L zard Date: Sat, 2 Nov 2024 13:18:43 +0100 Subject: [PATCH] build_config: fix `SDL_DEFAULT_ASSERT_LEVEL` Currently, `SDL_DEFAULT_ASSERT_LEVEL` is commented out by CMake when its value is 0, setting the assertions level to the default value instead of disabling them. This change: - defines `SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED` when its value is non-zero. - defines `SDL_DEFAULT_ASSERT_LEVEL`, regardless of its value, when `SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED` is defined. --- include/build_config/SDL_build_config.h.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/build_config/SDL_build_config.h.cmake b/include/build_config/SDL_build_config.h.cmake index 2b1bdcda4c..2d64c74b1d 100644 --- a/include/build_config/SDL_build_config.h.cmake +++ b/include/build_config/SDL_build_config.h.cmake @@ -228,8 +228,9 @@ #cmakedefine USE_POSIX_SPAWN @USE_POSIX_SPAWN@ /* SDL internal assertion support */ -#if @SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED@ -#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ +#cmakedefine SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED 1 +#ifdef SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED +#define SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ #endif /* Allow disabling of major subsystems */