Add method to allow variables to be marked as used

This commit is contained in:
Ben Boeckel 2010-09-15 11:34:35 -04:00
parent a0b0d23f0c
commit 02a114dfe8
2 changed files with 7 additions and 0 deletions

View File

@ -1735,6 +1735,11 @@ void cmMakefile::AddDefinition(const char* name, bool value)
#endif #endif
} }
void cmMakefile::MarkVariableAsUsed(const char* var)
{
this->Internal->VarUsageStack.top().insert(var);
}
bool cmMakefile::VariableInitialized(const char* var) const bool cmMakefile::VariableInitialized(const char* var) const
{ {
if(this->Internal->VarInitStack.top().find(var) != this->Internal->VarInitStack.top().end()) if(this->Internal->VarInitStack.top().find(var) != this->Internal->VarInitStack.top().end())

View File

@ -61,6 +61,8 @@ public:
unsigned int GetCacheMajorVersion(); unsigned int GetCacheMajorVersion();
unsigned int GetCacheMinorVersion(); unsigned int GetCacheMinorVersion();
/* Mark a variable as used */
void MarkVariableAsUsed(const char* var);
/* return true if a variable has been initialized */ /* return true if a variable has been initialized */
bool VariableInitialized(const char* ) const; bool VariableInitialized(const char* ) const;
/* return true if a variable has been used */ /* return true if a variable has been used */