From 52fdec589223ebc04987c12ad2c4d1e847e8e972 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 3 Dec 2016 16:06:09 +0000 Subject: [PATCH] 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. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ea0757c..3a236353 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,13 @@ if (MSVC) /EHsc /WX) 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() add_compile_options(-Wall -Werror