sdl12-compat: Turn off MSVC's aggressive C runtime warnings for the old test programs. (b4ba7)

From b4ba713f840de3717c192a3b71c0ff7547f6fe08 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 1 Jun 2021 22:03:17 -0400
Subject: [PATCH] Turn off MSVC's aggressive C runtime warnings for the old
 test programs.

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cfb05c1..ac9ee3e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,12 @@ if(SDL12TESTS)
         target_include_directories(${_NAME} PRIVATE "include/SDL")
         target_link_libraries(${_NAME} SDL)
         set_target_properties(${_NAME} PROPERTIES COMPILE_DEFINITIONS "HAVE_OPENGL")
+        # Turn off MSVC's aggressive C runtime warnings for the old test programs.
+        if(MSVC)
+          set_target_properties(${_NAME} PROPERTIES COMPILE_DEFINITIONS "HAVE_OPENGL;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE")
+        else()
+          set_target_properties(${_NAME} PROPERTIES COMPILE_DEFINITIONS "HAVE_OPENGL")
+        endif()
         if(MATH_LIBRARY)
           target_link_libraries(${_NAME} ${MATH_LIBRARY})
         endif()