SDL: cmake: define SDL_STATIC_LIB for static SDL2 library

From 83f5bbdf25eafa38818a60d6a0cea90d90e25dc7 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 28 Jul 2022 14:08:20 +0200
Subject: [PATCH] cmake: define SDL_STATIC_LIB for static SDL2 library

---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 853b15dd8a6..45128b2a711 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3096,6 +3096,7 @@ if(SDL_STATIC)
     set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
   endif()
   set_target_properties(SDL2-static PROPERTIES POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}")
+  target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB)
   # TODO: Win32 platforms keep the same suffix .lib for import and static
   # libraries - do we need to consider this?
   target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS})