summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-04-19 15:11:53 (GMT)
committerBrad King <brad.king@kitware.com>2019-04-19 16:56:49 (GMT)
commit1baf122cd41d6500139649661052236b8e684565 (patch)
treeec95252e332aa7098c5aca65f478b0e445481538 /Source/cmPolicies.h
parent8542152626590db6a13b20aa3d36214186c6b40d (diff)
downloadCMake-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 'Source/cmPolicies.h')
-rw-r--r--Source/cmPolicies.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 113dd35..0e42295 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -270,7 +270,10 @@ class cmMakefile;
15, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0091, \
"MSVC runtime library flags are selected by an abstraction.", 3, 15, \
- 0, cmPolicies::WARN)
+ 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0092, \
+ "MSVC warning flags are not in CMAKE_<LANG>_FLAGS by default.", 3, \
+ 15, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \