Index: flang/CMakeLists.txt =================================================================== --- flang/CMakeLists.txt +++ flang/CMakeLists.txt @@ -236,7 +236,11 @@ ${FLANG_BINARY_DIR}/include/flang/Config/config.h) # Add global F18 flags. -set(CMAKE_CXX_FLAGS "-fno-rtti -fno-exceptions -pedantic -Wall -Wextra -Werror -Wcast-qual -Wimplicit-fallthrough -Wdelete-non-virtual-dtor ${CMAKE_CXX_FLAGS}") +if(MSVC) + set(CMAKE_CXX_FLAGS "/GR- /EHs-c- /Wall ${CMAKE_CXX_FLAGS}") +else() + set(CMAKE_CXX_FLAGS "-fno-rtti -fno-exceptions -pedantic -Wall -Wextra -Werror -Wcast-qual -Wimplicit-fallthrough -Wdelete-non-virtual-dtor ${CMAKE_CXX_FLAGS}") +endif() # Builtin check_cxx_compiler_flag doesn't seem to work correctly macro(check_compiler_flag flag resultVar)