summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMichael Scott <michael.scott250@gmail.com>2015-11-08 23:06:33 (GMT)
committerBrad King <brad.king@kitware.com>2015-12-01 15:21:57 (GMT)
commitda688bcb3b7edc1da19fc8b89e2425f40d3fa7f1 (patch)
tree397299652bf5da60e7b27577516ecd7d8d3dfe5b /Source
parent07388f83b69739116c8364e9443f10158fcdc912 (diff)
downloadCMake-da688bcb3b7edc1da19fc8b89e2425f40d3fa7f1.zip
CMake-da688bcb3b7edc1da19fc8b89e2425f40d3fa7f1.tar.gz
CMake-da688bcb3b7edc1da19fc8b89e2425f40d3fa7f1.tar.bz2
Add -W options to control deprecated warning messages.
Add 'deprecated' warning options type, to allow setting CMAKE_WARN_DEPRECATED via the -W '-Wdeprecated' and '-Wno-deprecated' options. Add tests for new options and updated documentation.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx20
-rw-r--r--Source/cmake.h4
2 files changed, 23 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e6433bd..37d7e0a 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1263,6 +1263,26 @@ int cmake::Configure()
{
DiagLevel diagLevel;
+ if (this->DiagLevels.count("deprecated") == 1)
+ {
+
+ diagLevel = this->DiagLevels["deprecated"];
+ if (diagLevel == DIAG_IGNORE)
+ {
+ this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "FALSE",
+ "Whether to issue warnings for deprecated "
+ "functionality.",
+ cmState::INTERNAL);
+ }
+ else if (diagLevel == DIAG_WARN)
+ {
+ this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "TRUE",
+ "Whether to issue warnings for deprecated "
+ "functionality.",
+ cmState::INTERNAL);
+ }
+ }
+
if (this->DiagLevels.count("dev") == 1)
{
diff --git a/Source/cmake.h b/Source/cmake.h
index 1bd6d4d..8739b87 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -444,7 +444,9 @@ private:
{"-T <toolset-name>", "Specify toolset name if supported by generator."}, \
{"-A <platform-name>", "Specify platform name if supported by generator."}, \
{"-Wno-dev", "Suppress developer warnings."},\
- {"-Wdev", "Enable developer warnings."}
+ {"-Wdev", "Enable developer warnings."},\
+ {"-Wdeprecated", "Enable deprecation warnings."},\
+ {"-Wno-deprecated", "Suppress deprecation warnings."}
#define FOR_EACH_C_FEATURE(F) \
F(c_function_prototypes) \