diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1500fc72d03ce2f42530810224a8174c6d159ec..04e4263adbb7277d1126e35c974b23e251d40b2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@ include("FetchContent")
 
 if(MSVC)
 	add_compile_options("/FI${XPDevPlus_BINARY_DIR}/xpdevplus.h")
+	add_compile_definitions(NOMINMAX _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)
 else()
 	add_compile_options("SHELL:-include xpdevplus.h")
 endif()