OSDN Git Service

[cmake] Refactor warning flag logic to use Unix warnings with clang-cl
authorReid Kleckner <rnk@google.com>
Thu, 16 Mar 2017 17:05:16 +0000 (17:05 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 16 Mar 2017 17:05:16 +0000 (17:05 +0000)
commit7e21d8d3b19dcf51a3f2745213d3933b5227af67
treea83ad0359ad2692d05c318571509c114860c531a
parent800f10438aa67eb9d040db2a101106e35d92b475
[cmake] Refactor warning flag logic to use Unix warnings with clang-cl

Summary:
clang-cl understands the GCC-style -W[no-]foo flags, and for the most
part ignores MSVC -wd flags. So, let's pass the curated set of warning
flags we use on Unix on Windows. We can also stop passing /W4 -wd*,
which for the most part corresponds to -Wall -Wextra with a bunch of
flags that we mostly ignore.

I had to disable -Wnon-virtual-dtor on Windows, because it fires on
every COM class ever. I filed PR32286 to fix this.

So far I've only found two instances of -Wstring-conversion in the
WinASan code, which I'll fix. Other than that we seem clean.

Reviewers: hans

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D30992

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297964 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/HandleLLVMOptions.cmake