diff options
author | Brad King <brad.king@kitware.com> | 2014-04-02 18:54:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-04-02 18:54:17 (GMT) |
commit | 97243c22b29f453c6403f514f73e6b8dec127194 (patch) | |
tree | 3d89f18df42396d53e97f3b0d51bf5690fa6d1f8 /Source | |
parent | f180fc89255bdd72e5d1b49ba7e7cc8dcb77c72e (diff) | |
parent | a41c0a9dcbc201b183bcc0a0c0f6bf9f2cebd079 (diff) | |
download | CMake-97243c22b29f453c6403f514f73e6b8dec127194.zip CMake-97243c22b29f453c6403f514f73e6b8dec127194.tar.gz CMake-97243c22b29f453c6403f514f73e6b8dec127194.tar.bz2 |
Merge branch 'revise-compiler-id-policies' into release
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 16 | ||||
-rw-r--r-- | Source/cmMakefile.h | 2 |
3 files changed, 22 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4f3328d..beb10da 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -759,7 +759,8 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, switch(mf->GetPolicyStatus(cmPolicies::CMP0025)) { case cmPolicies::WARN: - if(!this->CMakeInstance->GetIsInTryCompile()) + if(!this->CMakeInstance->GetIsInTryCompile() && + mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025")) { cmOStringStream w; w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n" @@ -790,7 +791,8 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, switch(mf->GetPolicyStatus(cmPolicies::CMP0047)) { case cmPolicies::WARN: - if(!this->CMakeInstance->GetIsInTryCompile()) + if(!this->CMakeInstance->GetIsInTryCompile() && + mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) { cmOStringStream w; w << policies->GetPolicyWarning(cmPolicies::CMP0047) << "\n" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 11559d9..27ce999 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4350,6 +4350,22 @@ cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const return this->GetPolicies()->GetPolicyStatus(id); } +//---------------------------------------------------------------------------- +bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var) +{ + // Check for an explicit CMAKE_POLICY_WARNING_CMP<NNNN> setting. + if(!var.empty()) + { + if(const char* val = this->GetDefinition(var.c_str())) + { + return cmSystemTools::IsOn(val); + } + } + // Enable optional policy warnings with --debug-output or --trace. + cmake* cm = this->GetCMakeInstance(); + return cm->GetDebugOutput() || cm->GetTrace(); +} + bool cmMakefile::SetPolicy(const char *id, cmPolicies::PolicyStatus status) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 45f3b9f..f00fd20 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -875,6 +875,8 @@ public: std::set<cmStdString> const & GetSystemIncludeDirectories() const { return this->SystemIncludeDirectories; } + bool PolicyOptionalWarningEnabled(std::string const& var); + protected: // add link libraries and directories to the target void AddGlobalLinkInformation(const char* name, cmTarget& target); |