Przeglądaj źródła

FIX: foreach function-blockers were using expanded args. Add virtual func to specify if function blocker needs them expanded or not.

Sebastien Barre 23 lat temu
rodzic
commit
437a8c9816
3 zmienionych plików z 16 dodań i 2 usunięć
  1. 2 0
      Source/cmForEachCommand.h
  2. 2 0
      Source/cmFunctionBlocker.h
  3. 12 2
      Source/cmMakefile.cxx

+ 2 - 0
Source/cmForEachCommand.h

@@ -39,6 +39,8 @@ public:
                             cmMakefile &mf);
   virtual void ScopeEnded(cmMakefile &mf);
   
+  virtual int NeedExpandedVariables () { return 0; };
+
   std::vector<std::string> m_Args;
   std::vector<std::string> m_Commands;
   std::vector<std::vector<std::string> > m_CommandArguments;

+ 2 - 0
Source/cmFunctionBlocker.h

@@ -50,6 +50,8 @@ public:
   virtual void ScopeEnded(cmMakefile &mf) {}
 
   virtual ~cmFunctionBlocker() {}
+
+  virtual int NeedExpandedVariables () { return 1; };
 };
 
 #endif

+ 12 - 2
Source/cmMakefile.cxx

@@ -1187,9 +1187,19 @@ bool cmMakefile::IsFunctionBlocked(const char *name,
   for (pos = m_FunctionBlockers.begin(); 
        pos != m_FunctionBlockers.end(); ++pos)
     {
-    if ((*pos)->IsFunctionBlocked(name, expandedArguments, *this))
+    if ((*pos)->NeedExpandedVariables()) 
       {
-      return true;
+      if ((*pos)->IsFunctionBlocked(name, expandedArguments, *this))
+        {
+        return true;
+        }
+      }
+    else
+      {
+      if ((*pos)->IsFunctionBlocked(name, args, *this))
+        {
+        return true;
+        }
       }
     }