[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / cmake / modules / CheckProblematicConfigurations.cmake
blobe133873d756c131e3c4a0a82cf6304a3728bf14b
2 option(LLVM_ALLOW_PROBLEMATIC_CONFIGURATIONS OFF "Set this option to ON to allow problematic toolchain configurations. Use on your own risk.")
4 macro(log_problematic MESSAGE)
5   if(LLVM_ALLOW_PROBLEMATIC_CONFIGURATIONS)
6     message(WARNING "${MESSAGE}")
7   else()
8     message(FATAL_ERROR "${MESSAGE}\nYou can force usage of this configuration by passing -DLLVM_ALLOW_PROBLEMATIC_CONFIGURATIONS=ON")
9   endif()
10 endmacro()
12 # MSVC and /arch:AVX is untested and have created problems before. See:
13 # https://github.com/llvm/llvm-project/issues/54645
14 if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
15   string(TOLOWER "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}" _FLAGS)
16   if(_FLAGS MATCHES "/arch:avx[0-9]*")
17     log_problematic("Compiling LLVM with MSVC and the /arch:AVX flag is known to cause issues with parts of LLVM.\nSee https://github.com/llvm/llvm-project/issues/54645 for details.\nUse clang-cl if you want to enable AVX instructions.")
18   endif()
19 endif()