Browse Source

Fixed linker errors when compiling debug builds of SDL2.

Alex Szpakowski 10 years ago
parent
commit
eba4deb99e
1 changed files with 7 additions and 0 deletions
  1. 7 0
      libs/SDL2/CMakeLists.txt

+ 7 - 0
libs/SDL2/CMakeLists.txt

@@ -169,6 +169,13 @@ if(MSVC)
       endif()
     endforeach()
   endif()
+
+  # Make sure /RTC1 is disabled, otherwise it will use functions from the CRT
+  foreach(flag_var
+      CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+      CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
+    string(REGEX REPLACE "/RTC(su|[1su])" "" ${flag_var} "${${flag_var}}")
+  endforeach(flag_var)
 endif()
 
 # Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config,