diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8374e133fbd0ef040ef303065552b166f18f1ae2..6373cce09eb2413fec7f80e85294f35cf0515375 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,10 @@ if(NOT MSVC)
     )
 endif()
 
+if(MSVC)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -bigobj")
+endif()
+
 if(ASAN)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
 endif()