diff --git a/CMakeLists.txt b/CMakeLists.txt
index c27304ee23a001d51900fc1b002f33bc676f736e..6c3b27235ce3997def14b2af1b75967490793b4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,11 @@ include("FetchContent")
 
 include(ExternalProject)
 
-add_compile_options("SHELL:-include xpdevplus.h")
+if(MSVC)
+	add_compile_options("SHELL:/FI xpdevplus.h")
+else()
+	add_compile_options("SHELL:-include xpdevplus.h")
+endif()
 
 FetchContent_Declare(
 	CONIO
diff --git a/xpdevplus.h.in b/xpdevplus.h.in
index 6875c673109553cf48448486c17efcdaefdb6823..1241b356c4377b25789edfc340484e9f076f47de 100644
--- a/xpdevplus.h.in
+++ b/xpdevplus.h.in
@@ -7,5 +7,6 @@
 #cmakedefine HAS_STDINT_H
 #cmakedefine LINK_LIST_THREADSAFE
 #define DISABLE_MKSTEMP_DEFINE
+#define BUILD_WITH_MINGW_COMPAT
 
 #endif