diff options
author | Brad King <brad.king@kitware.com> | 2019-04-19 15:11:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-04-19 16:56:49 (GMT) |
commit | 1baf122cd41d6500139649661052236b8e684565 (patch) | |
tree | ec95252e332aa7098c5aca65f478b0e445481538 /Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake | |
parent | 8542152626590db6a13b20aa3d36214186c6b40d (diff) | |
download | CMake-1baf122cd41d6500139649661052236b8e684565.zip CMake-1baf122cd41d6500139649661052236b8e684565.tar.gz CMake-1baf122cd41d6500139649661052236b8e684565.tar.bz2 |
MSVC: Do not add /W3 to CMAKE_<LANG>_FLAGS by default
We do not add default warning flags on other compilers, and having
a warning flag in the default flags makes it hard for projects to
customize the warning level. They need to use string processing
to remove `/W3` from `CMAKE_{C,CXX}_FLAGS`. Therefore we should
drop it.
However, projects may be using string processing to replace `/W3`
with another flag, so we cannot simply drop it. Add a policy to
drop it in a compatible way.
Fixes: #18317
Diffstat (limited to 'Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake')
-rw-r--r-- | Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake b/Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake new file mode 100644 index 0000000..15c52d2 --- /dev/null +++ b/Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0092 NEW) +include(CMP0092-common.cmake) |