Browse Source

cmMakefile: Simplify CMP0054 handling.

Stephen Kelly 10 years ago
parent
commit
f9785e0cb6
3 changed files with 5 additions and 13 deletions
  1. 2 8
      Source/cmConditionEvaluator.cxx
  2. 2 3
      Source/cmMakefile.cxx
  3. 1 2
      Source/cmMakefile.h

+ 2 - 8
Source/cmConditionEvaluator.cxx

@@ -112,10 +112,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
 
   if(def && argument.WasQuoted() && this->Policy54Status == cmPolicies::WARN)
     {
-    bool hasBeenReported = this->Makefile.HasCMP0054AlreadyBeenReported(
-      this->Makefile.GetExecutionContext());
-
-    if(!hasBeenReported)
+    if(!this->Makefile.HasCMP0054AlreadyBeenReported())
       {
       std::ostringstream e;
       e << (cmPolicies::GetPolicyWarning(cmPolicies::CMP0054)) << "\n";
@@ -161,10 +158,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword,
   if(isKeyword && argument.WasQuoted() &&
     this->Policy54Status == cmPolicies::WARN)
     {
-    bool hasBeenReported = this->Makefile.HasCMP0054AlreadyBeenReported(
-      this->Makefile.GetExecutionContext());
-
-    if(!hasBeenReported)
+    if(!this->Makefile.HasCMP0054AlreadyBeenReported())
       {
       std::ostringstream e;
       e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0054) << "\n";

+ 2 - 3
Source/cmMakefile.cxx

@@ -4941,10 +4941,9 @@ bool cmMakefile::SetPolicyVersion(const char *version)
 }
 
 //----------------------------------------------------------------------------
-bool cmMakefile::HasCMP0054AlreadyBeenReported(
-  cmListFileContext context) const
+bool cmMakefile::HasCMP0054AlreadyBeenReported() const
 {
-  cmCMP0054Id id(context);
+  cmCMP0054Id id(this->GetExecutionContext());
 
   bool alreadyReported =
     this->CMP0054ReportedIds.find(id) != this->CMP0054ReportedIds.end();

+ 1 - 2
Source/cmMakefile.h

@@ -411,8 +411,7 @@ public:
    * Determine if the given context, name pair has already been reported
    * in context of CMP0054.
    */
-  bool HasCMP0054AlreadyBeenReported(
-    cmListFileContext context) const;
+  bool HasCMP0054AlreadyBeenReported() const;
 
   bool IgnoreErrorsCMP0061() const;