From 543f244965d5e84af5e1fe2b6401eb6457e15aed Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sun, 29 Dec 2024 18:58:10 +0100
Subject: [PATCH] tests: include SDL_build_config.h when HAVE_BUILD_CONFIG is
defined
---
test/CMakeLists.txt | 1 +
test/testautomation_intrinsics.c | 2 +-
test/testautomation_main.c | 2 ++
test/testevdev.c | 2 +-
4 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0f913f91e15d7..aec3eab28a98c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -121,6 +121,7 @@ macro(add_sdl_test_executable TARGET)
else()
add_executable(${TARGET} ${AST_SOURCES} ${EXTRA_SOURCES})
endif()
+ target_compile_definitions(${TARGET} PRIVATE HAVE_BUILD_CONFIG)
SDL_AddCommonCompilerFlags(${TARGET})
target_include_directories(${TARGET} PRIVATE "${SDL3_SOURCE_DIR}/src/video/khronos")
target_link_libraries(${TARGET} PRIVATE SDL3::SDL3_test SDL3::${sdl_name_component})
diff --git a/test/testautomation_intrinsics.c b/test/testautomation_intrinsics.c
index 9aba459c4bf6e..c3b5fa5422667 100644
--- a/test/testautomation_intrinsics.c
+++ b/test/testautomation_intrinsics.c
@@ -2,7 +2,7 @@
* Intrinsics test suite
*/
-#ifndef NO_BUILD_CONFIG
+#ifdef HAVE_BUILD_CONFIG
/* Disable intrinsics that are unsupported by the current compiler */
#include "SDL_build_config.h"
#endif
diff --git a/test/testautomation_main.c b/test/testautomation_main.c
index 3699d7ce18632..89991c02bbb61 100644
--- a/test/testautomation_main.c
+++ b/test/testautomation_main.c
@@ -9,7 +9,9 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
+#ifdef HAVE_BUILD_CONFIG
#include "SDL_build_config.h"
+#endif
/**
* Tests SDL_InitSubSystem() and SDL_QuitSubSystem()
diff --git a/test/testevdev.c b/test/testevdev.c
index e2442e39f672a..b4119ab9f69ec 100644
--- a/test/testevdev.c
+++ b/test/testevdev.c
@@ -21,7 +21,7 @@
#endif
#define SDL_DYNAMIC_API 0
-#ifndef NO_BUILD_CONFIG
+#ifdef HAVE_BUILD_CONFIG
#include "../src/SDL_internal.h"
#endif