SDL: ci: force PDB and runtime variables

From b5a7b1ca89f4187641aa25e411e69448a56955f3 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 11 Jul 2024 13:51:35 +0200
Subject: [PATCH] ci: force PDB and runtime variables

---
 .github/workflows/msvc.yml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml
index fee4a16a60a30..0aae792f33e9c 100644
--- a/.github/workflows/msvc.yml
+++ b/.github/workflows/msvc.yml
@@ -41,22 +41,22 @@ jobs:
         builddir = f"{ srcdir }/build"
         os.makedirs(builddir)
         cmakelists_txt = textwrap.dedent(f"""\
-          # MSVC debug information format flags are selected by an abstraction
-          set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction")
           # MSVC runtime library flags are selected by an abstraction
           set(CMAKE_POLICY_DEFAULT_CMP0091 "NEW" CACHE STRING "MSVC runtime library flags are selected by an abstraction")
+          # MSVC debug information format flags are selected by an abstraction
+          set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction")
           cmake_minimum_required(VERSION 3.0...3.25)
           project(sdl_user)
           # Always build .PDB symbol file
-          set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format")
-          set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables")
-          set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries")
+          set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format" FORCE)
+          set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables" FORCE)
+          set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries" FORCE)
           if(WINDOWS_STORE) # WINDOWS_STORE is available AFTER project()
             # UWP only supports dynamic runtime
-            set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" CACHE STRING "MSVC runtime libary")
+            set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" CACHE STRING "MSVC runtime libary" FORCE)
           else()
             # Use static runtime library
-            set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "MSVC runtime libary")
+            set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "MSVC runtime libary" FORCE)
           endif()
           enable_testing()
           add_subdirectory("{ srcdir }" SDL)