build: try to remove RTC1 from CMake build
@@ -24,6 +24,14 @@ endif()
if(MSVC)
add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
add_compile_options(/W3 /Ox /Gy /Oi /TC)
+
+ # Ref: https://skia.googlesource.com/third_party/sdl/+/refs/heads/master/CMakeLists.txt#225
+ # 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)
else()
add_compile_options(-Wall -Werror -O3)
endif()
