CMakeLists: Add support for LLVM on Windows

The LLVM project provides a clang-based MSVC compatible toolset for
Microsoft Visual Studio. This suite is sometimes refered to as "clang-cl".

This patch adds a few compiler flags to support this toolset.
This commit is contained in:
MerryMage 2016-12-03 16:06:09 +00:00
parent cede5e442a
commit 52fdec5892

View file

@ -37,6 +37,13 @@ if (MSVC)
/EHsc /EHsc
/WX) /WX)
add_compile_options(/DNOMINMAX) add_compile_options(/DNOMINMAX)
if (CMAKE_VS_PLATFORM_TOOLSET MATCHES "LLVM-vs[0-9]+")
add_compile_options(-Qunused-arguments
-Wno-unused-parameter
-Wno-missing-braces)
add_compile_options(-Xclang -fno-operator-names)
endif()
else() else()
add_compile_options(-Wall add_compile_options(-Wall
-Werror -Werror