Skip to content

Commit 6955f73

Browse files
committed
[flang] Add cmake error if building with clang-cl and MSVC 17.12
A bug in the C++ library in MSVC 17.12 prevents clang-cl from being able to build flang with that library version. This bug is not present in 17.11 or earlier, nor in 17.13. This patch adds a cmake error telling the user to either upgrade or downgrade to avoid the bug.
1 parent 290f38c commit 6955f73

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

flang/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ if (MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang)
6666
if (IS_DIRECTORY "${LIBDIR}")
6767
link_libraries(${CLANG_RT_BUILTINS_LIBRARY})
6868
endif()
69+
70+
if (MSVC_VERSION EQUAL 1942)
71+
message(FATAL_ERROR "Flang cannot be built with clang and the MSVC 17.12 "
72+
"toolchain version. Please upgrade to 17.13 or later, or switch "
73+
"to the 17.10 LTSC release. "
74+
"See https://github.com/microsoft/STL/issues/4959 for more details.")
75+
endif()
6976
endif()
7077

7178
if(CMAKE_SIZEOF_VOID_P EQUAL 4)

0 commit comments

Comments
 (0)