diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a55a629bd8c..09c656f8ccec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,11 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") add_compile_options(/bigobj) + # Use standard-conforming two-phase name resolution for templates. + # This minimizes the differences between g++/clang builds on Linux, + # and MSVC builds on Windows. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-") + # MSVC already errors on undefined symbols, no additional flag needed. set(TVM_NO_UNDEFINED_SYMBOLS "")