summaryrefslogtreecommitdiffstats
path: root/Source/cmake.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-12-02 13:42:06 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-12-02 13:42:06 (GMT)
commit3fa2fc71b119751bc915f0068d2046667fdefd32 (patch)
tree19a4793166b562bdd0478289702d1abf39e4bf00 /Source/cmake.h
parentda78a1648fd5d4452a98c46eb9af486d16c43c9a (diff)
parentaac633d5e5765bb6b51e31364325ae7d916f021c (diff)
downloadCMake-3fa2fc71b119751bc915f0068d2046667fdefd32.zip
CMake-3fa2fc71b119751bc915f0068d2046667fdefd32.tar.gz
CMake-3fa2fc71b119751bc915f0068d2046667fdefd32.tar.bz2
Merge topic 'cmake-W-options'
aac633d5 Explicitly enable deprecated warnings by default. e8974b62 Modify dev warning options to affect deprecated warnings. b146747e Consistent documentation for deprecation message variables. da688bcb Add -W options to control deprecated warning messages. 07388f83 Refactor the -W options parser to be generic. 246b0bfb Explicitly enable author (dev) warnings by default. deec3a3f Make message suppression more consistent. aa427a42 Tests: Revise message in RunCMake.CommandLine -Wdev case
Diffstat (limited to 'Source/cmake.h')
-rw-r--r--Source/cmake.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/Source/cmake.h b/Source/cmake.h
index c584ad9..4c5515b 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -68,6 +68,11 @@ class cmake
DEPRECATION_WARNING
};
+ enum DiagLevel
+ {
+ DIAG_IGNORE,
+ DIAG_WARN
+ };
/** \brief Describes the working modes of cmake */
enum WorkingMode
@@ -303,17 +308,28 @@ class cmake
std::string const& GetCMakeEditCommand() const
{ return this->CMakeEditCommand; }
- void SetSuppressDevWarnings(bool v)
- {
- this->SuppressDevWarnings = v;
- this->DoSuppressDevWarnings = true;
- }
+ void SetSuppressDevWarnings(bool v);
+ /*
+ * Get the state of the suppression of developer (author) warnings.
+ * Returns false, by default, if developer warnings should be shown, true
+ * otherwise.
+ */
+ bool GetSuppressDevWarnings(cmMakefile const* mf = NULL);
+
+ /*
+ * Get the state of the suppression of deprecated warnings.
+ * Returns false, by default, if deprecated warnings should be shown, true
+ * otherwise.
+ */
+ bool GetSuppressDeprecatedWarnings(cmMakefile const* mf = NULL);
/** Display a message to the user. */
void IssueMessage(cmake::MessageType t, std::string const& text,
- cmListFileBacktrace const& backtrace = cmListFileBacktrace());
+ cmListFileBacktrace const& backtrace = cmListFileBacktrace(),
+ bool force = false);
void IssueMessage(cmake::MessageType t, std::string const& text,
- cmListFileContext const& lfc);
+ cmListFileContext const& lfc,
+ bool force = false);
///! run the --build option
int Build(const std::string& dir,
@@ -351,8 +367,7 @@ protected:
cmGlobalGenerator *GlobalGenerator;
cmCacheManager *CacheManager;
- bool SuppressDevWarnings;
- bool DoSuppressDevWarnings;
+ std::map<std::string, DiagLevel> DiagLevels;
std::string GeneratorPlatform;
std::string GeneratorToolset;
@@ -419,6 +434,12 @@ private:
// Print a list of valid generators to stderr.
void PrintGeneratorList();
+ /*
+ * Check if messages of this type should be output, based on the state of the
+ * warning and error output CMake variables, in the cache.
+ */
+ bool IsMessageTypeVisible(cmake::MessageType t);
+
bool PrintMessagePreamble(cmake::MessageType t, std::ostream& msg);
};
@@ -430,7 +451,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) \